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: gdsimms on Jan 22, '04 11:37:50AM

Wouldn't an applescript facilitating creating links this way in Safari be nise to post in this thread?



[ Reply to This | # ]
Create cross-platform URL shortcut files
Authored by: Fofer on Jan 22, '04 11:51:52AM

Now you're talkin', gdsimms! A drag-and-drop conversion (for .webloc -> .url) would be pretty darn handy as well.



[ Reply to This | # ]
Create cross-platform URL shortcut files
Authored by: ecco on Jan 22, '04 01:05:55PM
This script creates an URL shortcut on your desktop. Put it in your Safari scripts folder ~/Library/Scripts/Applications/Safari and launch it from the script menu.

try
	tell application "Safari"
		activate
		set theURL to URL of (document of window 1)
		set theTitle to name of window 1
	end tell
	set theTitle to first word of theTitle
	set res to "[InternetShortcut]
URL=" & theURL
	
	do shell script "echo \"" & res & "\" > ~/Desktop/" & theTitle & ".url"
on error x
	activate me
	display dialog x
end try



[ Reply to This | # ]
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.

try
	tell application "Safari"
		activate
		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 | # ]
Script the Finder to create Mac OS X links
Authored by: scriptguy on Jan 22, '04 08:56:36PM
tell application "Finder"
	make new internet location file at desktop to 
		"http://www.apple.com" with properties {name:"Apple Link"}
end tell


[ Reply to This | # ]
Script the Finder to create Mac OS X links
Authored by: OSX_Apprentice on Jan 23, '04 06:36:17AM
Hello. Can anyone tell me what this special character...
...means in an AppleScript?

[ Reply to This | # ]
Line continuation or something like that...
Authored by: jecwobble on Jan 23, '04 09:54:56AM

I believe it allows you to take a statement that belongs on one continuous line and break it into two or more lines for readabilitie's sake.



[ Reply to This | # ]
Thanks! + New v. of Script Editor wraps automatically
Authored by: OSX_Apprentice on Jan 23, '04 04:12:59PM

Thank you! I suspected it was something like that but became suspicious.

Before posting my question, while trying to search for an answer, I did stumble across the following new feature of Script Editor version 2:
* Auto-wrapping of long script statements

(Source: http://www.apple.com/applescript/scripteditor/ )

I was almost going to say that is seems like that option-L character is a thing of the past, but I just realized that manual line breaks will still be necessary on websites like this one (to maintain readability) so the option-L thing will probably remain.

Regards.



[ Reply to This | # ]
OnMyCommand
Authored by: ssevenup on Jan 22, '04 09:44:33PM

If I can find the time, the hot ticket would be an OnMyCommand item that provides a "Save URL for PC" context menu item.

--Shweeet ;-)

Of course it's only useful on Cocoa browsers. Mozilla, Firebird and such only provide their own context menu items. For those (I use Firebird) you need a droplet to drag the url link onto. Applescript should be up to that challenge with a little help.

--MM

---
Mark Moorcroft
ELORET Corp. - NASA/Ames RC
Sys. Admin.



[ Reply to This | # ]
OnMyCommand
Authored by: dik on Jan 23, '04 08:48:05AM

er. OK beng completey stupid how do I run applesrcipts from Safari?



[ Reply to This | # ]