More URL Magic

Continuing with URL Magic, to create a file that opens up a URL (http, mailto, ftp, etc.) try the following code. Note: if you omit the ’ with properties {name:“name”}’ it will create a file with the URL name. It even creates somewhat descriptive icons.

OS version: OS X

set the_URL to "http://www.macscripter.net"
tell application "Finder" to make new internet location file at desktop to the_URL with properties {name:"MacScripter"}

--or

set the_URL to "mailto:steve@mac.com"
tell application "Finder" to make new internet location file at desktop to the_URL with properties {name:"Hailing the Mothership"}

--or

set the_URL to "itms://phobos.apple.com/WebObjects/MZSearch.woa/wa/com.apple.jingle.search.DirectAction/advancedSearchResults?artistTerm=Aqua&songTerm=an%20apple%20a%20day"
tell application "Finder" to make new internet location file at desktop to the_URL with properties {name:"A Great Song"}