Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Get Automator working again in iTunes 10 Apps
As has been already reported in Macworld, Automator actions that talk to iTunes all broke upon the release of iTunes 10.0. This is because each action specifies in a text string in its Info.plist file that it requires iTunes version 4.6 or higher, and alphabetically, '10.0' is smaller than '4.6.' I frequently use 'Add to iTunes as a Spoken Track' (activated in System Preferences » Keyboard » Services). Here is how I got it working again.

'Add to iTunes as a Spoken Track.workflow' is found in /System/Library/Services. Navigate to that location and double-click the workflow file. Don't Panic! We are not going to modify this file; we're just looking for error messages when it's opened in Automator.

Automator complains that the actions 'Import Audio Files' and 'Add Songs to Playlist' could not be loaded because the application iTunes is the wrong version.

Navigate to /System/Library/Automator. WARNING: Do not modify files found under /System! Copy 'Import Audio File.action' and 'Add Songs to Playlist.action' to a convenient location in your User area. After copying, right-click on one of those files and select 'Show Package Contents.' Inside the package you will find a Contents folder within which is an Info.plist file. Open this file in your favorite text editor. Look for a section of text that looks something like this:
<array>
  <dict>
    <key>Display Name</key>
    <string>iTunes</string>
    <key>Resource</key>
    <string>com.apple.iTunes</string>
    <key>Type</key>
    <string>application</string>
    <key>Version</key>
    <string>4.6</string>
  </dict>
</array>
Delete the 'Version' line and the '4.6' line (the last two lines in the dict entry). Save. Repeat this process for the other action file.

Launch Automator. Select File » Import Actions... and choose the actions you just modified. These modified actions will be placed in ~/Library/Automator. You may want to color-label them so that they can be removed if/when Apple fixes this problem. You probably will want to log out/log back in to get your workflow working.

This process should work for any iTunes-related Automator action that broke when iTunes 10.0 was released.

[crarko adds: I tested this, and it works exactly as described. Presumably Apple will fix this shortly.]
    •    
  • Currently 3.38 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (16 votes cast)
 
[19,463 views]  

Get Automator working again in iTunes 10 | 12 comments | Create New Account
Click here to return to the 'Get Automator working again in iTunes 10' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Get Automator working again in iTunes 10
Authored by: DougAdams on Sep 03, '10 07:45:02AM

This version string problem affects AppleScripts running with iTunes 10 as well. A script that attempts to compare iTunes 10's version string, "10.0", to a specific version, say "4.0.1", will fail because "10.0" is not greater than "4.0.1". At least, as far as AppleScript is concerned. (I have been updating scripts at my site in this regard; mostly just yanking the version check routines.)

---
Doug's AppleScripts for iTunes
dougscripts.com



[ Reply to This | # ]
Get Automator working again in iTunes 10
Authored by: CaptnEvilStomper on Sep 03, '10 01:28:39PM
Just out of curiosity, why couldn't you just test the version number as a number instead of a string? For example:
tell application "iTunes"
    if version as number < 4.9 then
        display dialog "This AppleScript requires iTunes 4.9 or better." buttons {"Cancel"} default button "Cancel"
    end if
end tell


[ Reply to This | # ]
Get Automator working again in iTunes 10
Authored by: rab777hp on Sep 03, '10 10:29:21AM

thank you so much!
I make many applications which rely on iTunes integration via automator.



[ Reply to This | # ]
Get Automator working again in iTunes 10
Authored by: loren_ryter on Sep 03, '10 10:41:17AM
Doug (and anyone else interested),

While this isn't a solution for automator, if you're using applescript, here's a routine I (and as WBC) have been using since iTunes 9 in anticipation of iTunesVersionGate10 aka iTunesVersionD-Day aka i10K:

tell application "iTunes"
	set vers to (version) as string
	set versbase10 to my create_base_10_version(vers)
	-- rest for testing result in script edtior
	set compare_string to "9.2.1"
	set compare_versbase10 to my create_base_10_version(compare_string)
	set result to {compare_string, compare_versbase10, vers, versbase10, (versbase10 > compare_versbase10)}
end tell

on create_base_10_version(version_string)
	(*
	this routine modified by wooden brain concepts, http://www.woodenbrain.com
	based on a routine originally written by an unknown scripter intended for use with DEVONthink
	it works equally well for iTunes
	it's still a bit of a hack but should work for any version string up to version "99.X.X.X"
	who thought these sort of version strings were a good idea in the first place??
	*)
	set pad_number to 9
	set oldDelim to AppleScript's text item delimiters
	set sys_delimiter to "."
	if version_string contains "," then set sys_delimiter to ","
	set AppleScript's text item delimiters to sys_delimiter
	set digit_list to every text item in version_string
	log digit_list
	set base_10 to 0
	repeat with this_digit in digit_list
		-- these lines need to be modified if version strings might end like "9.5beta1"; right now it would ignore the "beta1" part and go with "9.5" 
		if this_digit contains "beta" then set this_digit to (characters 1 through ((offset of "beta" in this_digit) - 1) of this_digit) as string
		if this_digit contains "pb" then set this_digit to (characters 1 through ((offset of "pb" in this_digit) - 1) of this_digit) as string
		set base_10 to (base_10 as number) * 100 + this_digit
	end repeat
	set base_10 to base_10 * (10 ^ (pad_number - (length of (base_10 as string))))
	if ((first item in digit_list as number) is greater than or equal to 10) then set base_10 to ("1" & base_10 as string)
	set AppleScript's text item delimiters to oldDelim
	return (base_10 as number)
end create_base_10_version


[ Reply to This | # ]
Get Automator working again in iTunes 10
Authored by: Jonathan David on Sep 03, '10 11:05:01AM

I guess I will have to wait for an Apple fix as I don't feel confident enough to mess with the innards.

I have found that CKs Text to Speech applications still work.



[ Reply to This | # ]
Get Automator working again in iTunes 10
Authored by: DizzyPenguin on Sep 06, '10 02:13:17AM
Wow, that looks like a major headache when (since Mac OS X 10.4) you could simply use a considering numeric strings statement.

tell application "iTunes"
	set vers to version as string
	set compare_string to "9.2.1"
	considering numeric strings
		set result to {compare_string, vers, (vers > compare_string)}
	end considering
end tell
---
Manage your iTunes Album Artwork > http://dizzypenguin.com/automac-it/


[ Reply to This | # ]
Get Automator working again in iTunes 10
Authored by: offline on Sep 03, '10 11:05:33AM

Add Songs to iPod.action has the same version check. I'm assuming this should also be changed. Am I right?



[ Reply to This | # ]
Get Automator working again in iTunes 10
Authored by: asmeurer on Sep 04, '10 03:50:27PM

It's a good idea in general when checking version numbers to parse the version number into a format that will always sort correctly. For example, in languages where the list object sorts lexicographically (such as Python; does AppleScript do this?), you could parse a version such as 10.6.3 into [10, 6, 3]. Of course, unexpected extra letters or numbers can throw and well written code off, but it will be immune to things like a bump in the higher version number when you only expected bumps in the lower version number (such as comparing only the number after the dot, so 3.0 evaluates less than 2.5, because you were only expecting 2.6, 2.7, 2.8, etc.), or incorrect string comparisons when you add a new digit to one of the numbers, as demonstrated here.



[ Reply to This | # ]
Get Automator working again in iTunes 10
Authored by: C172Pilot on Sep 05, '10 02:51:15PM

Action "Update_iPod" needs to changed as well. Although you can perform the same task with Applescript. FYI..



[ Reply to This | # ]
Get Automator working again in iTunes 10
Authored by: MartiNZ on Sep 05, '10 03:35:17PM

This is a pretty funny one. I like it when updates cause unforeseen weirdness. I wonder if the fact that the iTunes dashboard widget hasn't worked properly since iTunes 8 could be fixed in a similar fashion.



[ Reply to This | # ]
Get Automator working again in iTunes 10
Authored by: chmatrix on Sep 28, '11 01:27:54AM

Hi,

I just solved the problem pretty easily: earlier, on snow leopard, automator had to be set to work in 32bit instead of 64bit otherwise there has been a lot of error messages.
I tried to do the same with iTunes and, oh miracle, it works:

close iTunes then go to Applications -> right click on iTunes -> read informations -> check the box to run the app in 32bits and restart iTunes and .... that's it.

I work in a local radio in Belgium and I rely on automator on an everyday basis to download then add prerecorded broadcasts to iTunes to be aired with Lion server and I was stuck since a few weeks because of that problem. Now I can finally work again :-)

English is not my native language so please forgive me for my mistakes ... :-)



[ Reply to This | # ]
Get Automator working again in iTunes 10
Authored by: CraigReynolds on Jan 11, '12 11:43:16AM

Hasn't Apple fixed this issue yet?



[ Reply to This | # ]