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


Click here to return to the '10.6: Create new AppleScript document Service' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.6: Create new AppleScript document Service
Authored by: diorite on Mar 24, '11 01:53:05PM

Nice tip. Too bad more examples on the web aren't URL encoded to make opening in Script Editor a one-click action.

Example:
applescript://com.apple.scripteditor?action=new&script=set%20whatItem%20to%20(do%20shell%20script%20%22diskutil%20list%20%7C%20grep%20'My%20HD%20Name'%22)%0Ddo%20shell%20script%20%22diskutil%20mount%20%22%20&%20(last%20word%20of%20whatItem)

There can be no spaces in the URL string.

As a clickable link, this opens Script Editor with a script called "Mount a connected firewire drive" in its window. Always nice when someone takes a moment for this extra touch.

D



[ Reply to This | # ]
applescript://com.apple.scripteditor?action=new&script=
Authored by: xhinter on Mar 26, '11 06:01:22PM
Well, this is actually the hint.
crarko, could you integrate it in the site?

[ Reply to This | # ]
10.6: Create new AppleScript document Service
Authored by: Maxikubik on Mar 30, '11 04:53:36AM
Cool, then we can simply boil the service AppleScript down to this:
on run {input, parameters}
	open location "applescript://com.apple.scripteditor?action=new&script=" & (input as string)
	return input
end run


[ Reply to This | # ]