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: Maxikubik on Mar 25, '11 05:36:24AM

I did not know there was already a service for this, even though I looked for it (not closely enough apparently). I'm running 10.6 and I found it under the development services just like crarko adds above.

By the way, here is an update to my original hint above, preventing script failure when AppleScript Editor is running with no open documents:


on run {input, parameters}
	
	tell application "AppleScript Editor"
		activate
		if (count documents) > 0 and contents of document 1 is "" then
			set contents of document 1 to (input as string)
		else
			make new document with properties {contents:(input as string)}
		end if
	end tell
	
	return input
end run


[ Reply to This | # ]
10.6: Create new AppleScript document Service
Authored by: Lri on Mar 26, '11 03:53:44AM
ASE behaves strangely with make new document with properties {contents:(input as string)}.

For some reason it checks for errors. Sometimes the dialog opens behind the created document, sometimes it doesn't appear at all.

This seemed to fix it:
set doc to make new document
set text of doc to input


[ Reply to This | # ]