Reputation: 338
I'm working on internal project that generates an applescript based on a web form.
I can generate the correct script, but I'd like the option for somebody to click "run script" from the browser and have it do its thing, rather than copying and pasting the generated script into osx's script editor.
http://www.macosxautomation.com/applescript/linktrigger/
I've read through above but honestly it's not detailed enough for me to make useful sense of. Has anybody had luck with this?
Upvotes: 0
Views: 649
Reputation: 91
You can create a link to Script Editor like this:
<a href="applescript://com.apple.scripteditor?action=new&script=display%20dialog%20%22Hello%20World!%22">Link</a>
In the example above the action parameter is set to create a new document and the script parameter defines the script copied to the new script document. After clicking the link a couple of confirmations are asked.
Apple uses this method in its Mac Automation Scripting Guide where you can test how it works.
Executing a script directly from a browser would be a massive security risk.
The method you linked would require that the script is already saved on user's computer as an application bundle.
Upvotes: 2