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

Click here to return to the 'Create cross-platform URL shortcut files' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create cross-platform URL shortcut files
Authored by: jrybolt on Jan 22, '04 05:39:21PM
Just a refinement of the above script to rename the end file to the whole title of the page. It seems to work fine, however I am testing it to make it a little more error proof. Here is the start.

	tell application "Safari"
		set theURL to URL of (document of window 1)
		set theTitle to name of window 1
	end tell
	set theTitleLong to theTitle & ".url" as string
	set theTitleShort to first word of theTitle & ".url"
	set res to "[InternetShortcut] URL=" & theURL
	do shell script "echo \"" & res & "\" > ~/Desktop/" & theTitleShort
	set theTitleShort to theTitleShort as string
	set the source_folder to path to desktop folder as string
	set this_item to (source_folder & theTitleShort) as alias
	tell application "Finder"
		set the name of this_item to theTitleLong
	end tell
on error x
	activate me
	display dialog x
end try
Hope this helps someone
btw great idea.

[ Reply to This | # ]