iTunes AppleScript won't use default browser
iTunes AppleScript won't use default browser
- Subject: iTunes AppleScript won't use default browser
- From: "Bob Swerdlow" <email@hidden>
- Date: Mon, 1 Dec 2003 12:55:35 -0500
I'm adding some scripts to iTunes to allow web searches based on the
currently selected song. However, I've found that once I create the target
URL, calling 'open location targetURL' does NOT open the default web browser
when the script is run from the iTunes menu. Instead, iTunes creates a new
item in its playlist with the end of the URL as its name. I think this is
because iTunes has its own 'open location' command which is supposed to open
an audio stream on the Internet and play it.
Interestingly, when I run the script in the Script Editor, it works fine.
The 'open location targetURL' command is NOT within the 'tell application
"iTunes"' block, so it is run by the Script Editor. However, running the
script from iTunes seems to mean that iTunes will process that command. I
tried directing this command to the Finder with a 'tell application
"Finder"', but the Finder does not understand 'open location' for a URL. I
CAN get it to work if I use 'tell application "Script Editor"', but I cannot
be sure my end users will have Script Editor.
I can also get it to work if I use 'tell application "Internet Explorer"' or
'tell application "Safari"', but I want it to use the DEFAULT browser
selected by the user rather than forcing it one way or the other.
So, is there a way to get the name of the default browser in AppleScript? I
see that this setting is available in the user's
com.apple.LaunchServices.plist file - do I need to read it from there? Is
there an easy way to read plists in AppleScript? Or, is there a way to use
'open location targetURL' from within iTunes that will open the URL in the
default browser rather than in iTunes itself?
Thanks!
Bob Swerdlow
COO
Transpose
email@hidden
207-781-8284
http://www.transpose.com
----------------------------------
Fight Spam!
Add this link to your signature (as I did):
http://wecanstopspam.org
Click through to find out more.
----------------------------------
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.