dougscripts.com

AppleScript

August 27 2009 - 10:36 am

Snow Leopard's QuickTime Player Duality

Speaking of Optional Installs, to get the AppleScript goodness of QuickTime Player you may have been used to, QuickTime Player 7 will need to be installed from Snow Leopard's Optional Installs. QuickTime Player 10.0 is the default install in /Applications/, but its AppleScript innards are radically different (some would say severely lacking) from previous versions. So for legacy purposes, you'll need QTP7. If you currently have QuickTime Pro, QTP7 is installed automatically in /Applications/Utilities/. Otherwise, it's an optional install.

August 27 2009 - 7:19 am

(Apple)Script Editor in Snow Leopard

I know I'm going to be repeating this a lot: as of Mac OS 10.6 the Script Editor application has been renamed AppleScript Editor and has been relocated from the /Applications/AppleScript/ to the /Applications/Utilities/ folder.

Also, Rosetta, which allows PowerPC-compiled applications and AppleScripts to run on Intel Macs, is an optional install. Most AppleScripts on this site are either Intel-compiled or Universal Binary, but some older scripts may not run without Rosetta (especially if you had downloaded older versions of them or those that I never got around to updating as Universal Binary). So when performing your installation of Snow Leopard it's probably a good idea to include Rosetta.

August 11 2009 - 10:44 am

Re-Posting Stream Startup Script

A couple few days ago I posted a script here that would ping the Radio Paradise stream until its server accepted the connection, suppressing the error dialog that would appear when a connection was denied. Well, that was the wrong version of the script. Here is the correct version, and the one I fire up every morning. You must select a radio stream track first, then run the script:

tell application "iTunes"
	if selection is {} then return
	set strm to (item 1 of selection)
	if (get class of strm) is not URL track then return
	repeat
		try
			play strm
			exit repeat
		on error m number n
			delay 15
		end try
	end repeat
end tell


The earlier script used the open location command, errors from which could not be defeated with the try block.

August 10 2009 - 9:55 am

UPDATED: Music Folder Files Not Added, v1.1

Music Folder Files Not Added is an application that will list the file paths of the files in your designated "iTunes Music" folder which are not in iTunes' library. Additionally, you can select a different parent folder and its contents will be compared to the iTunes library. Includes options to Add a selection of found files to iTunes or move them to the Trash.

This latest version fixes a problem with file paths containing single-quote characters.

August 10 2009 - 9:49 am

UPDATED: Lyrics via LyricWiki v2.0

Since LyricWiki is no longer able to provide lyrics to applications from its API, I put a workaround in Lyrics Via LyricWiki. This script will use the name and artist of the single selected or playing track as the basis for a SOAP query to LyricWiki.org; fruitful results will be displayed so you can choose to apply the lyrics to the particular track.

June 10 2009 - 8:15 am

It's a None/All Bug

The "none" bug I described yesterday turns out to be a bit more extensive: it's a "none/all" bug.

iTunes 8.2 introduces a bug whereby the the use of the none value with special kind and video kind, and the all value with song repeat in AppleScripts compiled in iTunes 8.1.1 and earlier will not work correctly in iTunes 8.2. I understand that Apple is aware of this situation and assume a fix will be forthcoming in a future version.

If you encounter an error caused by this bug, chances are you are running iTunes 8.2 and the script had been compiled and saved with an earlier version of iTunes.

The fix is to open the script in Script Editor, look for chevron-bound raw constants, and replace them with the appropriate bare-word value. For example, if you see «constant eSpKkSpN» change this to none. (I'm afraid I don't know what the raw constant for "all" is, but it would appear with a song repeat command; song repeat takes the values "off", "one", and "all"). Then re-save the script; it will compile referencing iTunes 8.2 aete and will work fine. Such recompiled scripts, however, will then not work with pre-iTunes 8.2.

June 9 2009 - 8:14 pm

Special Kind Playlist Property Weirdness, ctd

A little more about the "none" bug, mentioned earlier today. Any script compiled and saved before iTunes 8.2 which uses the "none" constant with playlist's special kind property will error. Thus, if you get an error concerning "«constant eSpKkSpN»" then it is most likely this bug.

The fix, as I also mentioned earlier, is to open the script with Script Editor, making a note of whether the script's format is compiled (.scpt or .scptd extension) or application (.app extension), and replacing any occurrence of «constant eSpKkSpN» with the bare word none. Then "Save as..." the script, making sure the File Format in the save dialog is set as you noted.

The script should run fine under iTunes 8.2, but, because it has been re-compiled, will not under iTunes 8.1.1 and earlier.

June 9 2009 - 1:11 pm

Special Kind Playlist Property Weirdness

A script I had written a year ago looks for playlists whose smart is false and special kind is none. Since updating to iTunes 8.2 it is showing as raw «constant eSpKkSpN». The error is: "Can’t get name of every user playlist whose smart = true and special kind = «constant eSpKkSpN»."

If I open the script and change «constant eSpKkSpN» to "none" then save, all's OK.

May 27 2009 - 10:19 am

ScriptPal v1.1 Posted

I posted ScriptPal v1.1 on Monday. This new version can now display the contents of the user "Scripts" folder (~/Library/iTunes/Scripts/) and/or the local "Scripts" folder (/Library/iTunes/Scripts/), can add a script to an existing Workgroup via the contextual menu, and addresses a couple of minor issues.

May 11 2009 - 10:34 am

UPDATED: Lyrics Via LyricWiki v1.1

Lyrics Via LyricWiki has been updated to v1.1. This script will use the name and artist of the single selected or playing track as the basis for a SOAP query to LyricWiki.org; fruitful results will be displayed so you can choose to apply the lyrics to the particular track.

Latest version addresses issue with properly converting high ASCII text.

Site contents © 2001 - 2024 (that's right: 2001) Doug Adams and weblished by Doug Adams. Contact support AT dougscripts DOT com. About.
All rights reserved. Privacy.
AppleScript, iTunes, iPod, iPad, and iPhone are registered trademarks of Apple Inc. This site has no direct affiliation with Apple, Inc.
The one who says "it cannot be done" should not be interrupting the one who is doing it.