Archive for the ‘iTunes’ Category

August 28 '10 - 10:32 am

Add Pages ePubs to iTunes Automatically for iBooks Sync

The latest update to Pages.app allows docs to be exported in the ePub format. ePub is one of the formats that can be read by the iBooks app. Now, in order for documents to get onto your iPhone/iPad you have to add them to iTunes. By hand? No! Automatically with a Folder Action! Below is a script which you should save to your /Library/Scripts/Folder Action Scripts folder. Attach the script as a folder action to a designated “ePub Export” folder, which you will create. Whenever you “Export…” a Pages doc to that “ePub Export” folder, it will automatically be added to iTunes’ Books library and eventually sync to your iPhone/iPad.

If your iTunes is set to “Copy files to iTunes Media folder when adding to library”, then you may want to delete the original from the “ePub Export” folder; just un-comment the (* *) section in the script by removing the (* and *) and saving the script.

on adding folder items to my_folder after receiving the_files
	repeat with i from 1 to number of items in the_files
		set this_file to (item i of the_files)
		tell application "Finder"
			if (get name extension of this_file) is not "epub" then return
		end tell
		tell application "iTunes"
			try
				add this_file

				(*
				-- if you have iTunes set to
				--"Copy files to iTunes Media folder when adding to library"
				-- then you might want to delete the original file...
				-- if so, remove comments from this block and
				-- use the UNIX commands below to delete the file

				do shell script ("rm -f " & quoted form of  POSIX path of (this_file as text))

				*)
			end try
		end tell
	end repeat
end adding folder items to


More info on Folder Actions for iTunes is located here.

July 25 '10 - 11:32 am

Re: Scripting Bug with iTunes 9.2.1?

Apple may be aware of the issue. This Discussions thread discusses the issue and RoyB suggests re-downloading and re-installing iTunes 9.2.1(5)—you may have 9.2.1(4)—as a solution. (Thanks Tom R.)

Update: I forgot to mention that Software Update will not report v9.2.1(5) as a newer version if you have 9.2.1(4). You must download iTunes from this page at Apple and install it from the disk image.

July 20 '10 - 8:51 am

PDF Adder and Safari Reader

I hadn’t realized this until giving it a shot this morning, and I haven’t seen this mentioned elsewhere: I’ve been taking advantage of Safari Reader mostly for reading long form stuff (Esquire magazine has a lot of their classic articles on line, for example). For laughs, while the Reader window was open, I hit Safari’s Print button to see if the Reader formatting is what gets recognized, rather than the original page. Perhaps not so surprisingly, it is!

Now it’s a simple matter of using the “Add as PDF to iTunes” PDF Service in the PDF Adder collection to add the Reader-formatted page to iTunes’ Books category and from there sync to iBooks. Of course, I’ve been PDFing stuff like this from Safari for awhile, but hadn’t thought to try it with Safari Reader. Neat!

July 19 '10 - 7:42 pm

iTunes 9.2.1 Released

Apple has released iTunes 9.2.1 and it looks like there’s a nice batch of fixes there. I won’t have time to check tonight, but I’ll report any AppleScript-related stuff as soon as I can.

posted in iTunes
July 6 '10 - 9:23 am

Spins Ranks Your Most-Played Tracks

Spins analyzes your iTunes library and displays rankings of your most-played tracks. You can configure Spins to show rankers and breakouts based on spins by Song, Artist, Album; rankings can be filtered by Rating, Genre, and Year; see rankings for the entire library or a single playlist. Spins can monitor iTunes and display ranking information updates for the current track. You’ll find that Spins is easy to configure and even fun to use.

Give Spins a spin…check out the demo and see what you’ve been spinning. If you like Spins, $10 unlocks the full-featured version.

posted in iTunes
June 23 '10 - 12:19 pm

UPDATED: PDF Adder v3.1

Since mentioning PDF Adder in the last post I have confirmed that a PDF added using the PDF Services script defaults to a Media Kind of “Book”. This means that these PDFs will automatically go to the “Books” library in iTunes, and will then sync with the iBooks app on the iPhone.

As an example of how cool this is: my wife and daughter are traveling to France in July. My wife “printed” a ton of itinerary and Google maps as PDFs to iTunes. They are now easily accessible from her iPhone’s iBooks app for offline perusing (essential when avoiding online roaming charges in Europe).

As a result, I decided to update the PDF Adder scripts so that a Category can be entered (the genre tag). I also changed “Artist” labels to “Author”.

posted in iTunes
June 21 '10 - 8:15 pm

Assistance with PDFs, iBooks and iTunes

Now that iOS 4 and iBooks allow you to sync PDFs to your iPhone you may be interested in using iTunes as a PDF manager. And if so, may I recommend PDF Adder. This set of scripts assist with adding PDF files to iTunes as “digital booklet” PDF tracks. Each provides a method for easily supplying Artist and Album tag data which is then applied to the newly-added PDF track:

The only thing these scripts can’t do is change the track’s “Media Kind” to “Book”, which may be necessary in order for PDFs to sync to the iBooks app. (This is a limitation of iTunes’ AppleScript architecture, not a limitation of the scripts.)

posted in iTunes
June 10 '10 - 2:03 pm

NEW: Report Real Play Time

Correspondent Jamie Shaw sent me a version of a script that calculates the play time of selected tracks or tracks in a playlist when the user-set Start and Stop times are also accounted for. In such cases, the total play time (for a playlist) would be shorter than what is displayed along the bottom of the playlist. I threw in a routine that lets you enter your Crossfade time (not really accessible programatically) and this is also part of the calculation. Report Real Play Time works especially nice when assigned a keyboard shortcut.

posted in Managing Tracks, iTunes
June 1 '10 - 7:04 pm

NEW: Delete Empty Playlists

You’d think just about every obvious iTunes housekeeping task imaginable would have been automated by now. You’d think. And so I thought also. Until I received a suggestion from Correspondent Holly B.:

“I am doing a major itunes library overhaul, and I used your batch playlist delete script, which was a huge improvement over the native iTunes one-at-a-time approach. I wanted to suggest a script that deletes empty playlists. I use smart playlists for management, and wouldn’t want to delete empty ones, but I would want to delete empty non-smart playlists.”

And it figures that it’s also something I would use from time to time as well. So I whipped up Delete Empty Playlists. You can delete all empty playlists or select specific empty playlists to delete.

posted in iTunes
May 19 '10 - 6:49 pm

UPDATED: Track Number to Song Name Prefix v2.1

I discovered that I inadvertently left behind a bit of debugging code in the version I last posted so I removed it and have updated Track Number to Song Name Prefix to v2.1. This script will prefix the song name of each selected track with its corresponding track number (if it has one).

posted in iTunes
This column is printer-friendly.
Site contents © 2001 - 2010 Doug Adams and weblished by Doug Adams, dougscripts AT mac DOT com.
All rights reserved. Legal.
AppleScript, iTunes, and iPod are registered trademarks of Apple Inc.
Image 01 Image 01 Image 01 Image 01 Image 01 Image 02 Image 03 Image 03 Image 03 Image 03