0

I tried to embedded apple script in a link in HTML, but all it does is brought up the Apple Script Editor Application with profiled script in it.

I want it to execute after I click on the link - so I don't have to press the play button.

Can someone help me fix this real quick ?

link.html

<a href = " 

applescript://com.apple.scripteditor?
action=new&script=

tell application %22Safari%22%0D%09
make new document with properties {URL:%22https://www.google.com%22}%0D%09 

end tell "> 

Click me to run the script ! 

</a>

Result:

enter image description here

6
  • That is dependent on the user's browser / operating system. How a mac chooses to open a file is completely up to it, and to my knowledge, there's nothing you can do about it in code. Commented Feb 12, 2015 at 2:39
  • Are you trying to say that - what I am trying to do is impossible ? Commented Feb 12, 2015 at 2:52
  • I'm saying that you can probably do it on your own computer, but I don't think you can do it for anyone else's computer. Commented Feb 12, 2015 at 2:57
  • I see. Even if for my own computer, do you know how to make it run ? Commented Feb 12, 2015 at 3:03
  • It can be done. I did it a while back for mac users. It was necessary to first have the applescript installed on the client's machine. If you google how to do it, you'll find examples. Commented Feb 12, 2015 at 4:41

1 Answer 1

1

You'll find your answer to your question here.

You'll also want to install the RCDefaults preference pane.

You have to use the full protocol, with the '?' and all that, in order to make your own protocol work as expected. You have to follow the scheme, or whatever that is called, for that kind of requests. The linktrigger demo at MaxOsXAutomation.com, worked for me, within the last month.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.