![]() |
how to launch an AppleScript from a link in a web page?
We have a Intranet and have an apple script. We are trying to figure out the proper commend set within HTML to launch a local Apple script once a button is pressed within a local webpage..:confused:
Any Help??? |
the specific thing your asking can't be done. HTML has no capacity to launch a script, Javascript can't do it either (at least not as far as I know, which is pretty far...).
you realize, of course, that the reason you can't launch a script from a webpage is the same reason you can't launch an application - it's a horrible security hole. an applescript that would delete your home directory is 4 lines long; deleting it irretrievably might take 10 lines. you want that popping up over the web? maybe if you explain more clearly what you're trying to do, we can suggest alternate approaches. |
I would like to thank everyone for their help.. We were able to pull this off by using MissingLink.
thanks again.. you all saved us... |
I suspect you are talking about missinglink from scriptbuilders.net
To save others googling to find out what the OP is talking about, Quote:
|
Quote:
|
If I _hadn't_ made Missing Link run-only, I would consider it a security hole too...
Peter B. ----- |
Quote:
You seem to be saying that if you released the source code for "Missing Link", that would somehow make it less secure - I don't see how that could be the case. |
Quote:
|
hayne:
Though Missing Link now runs to several hundred lines of vanilla AppleScript code, the basic functionality is available in maybe ten or twenty... I haven't counted recently. It requires additional preparation to work properly, but if I published a 'recipe' in open source, I would consider that an invitation to malicious abuse. The extra code helps lock it down to local use... by a single local user. It isn't bulletproof yet, but I continue work on it, and the next version will be still more secure. It will have to be... the version in preparation will now run compiled scripts (not merely applications) from links. ML definitely has local utility... and is intended only for local use. Peter B. ----- |
tw:
By all rights, Apple should be aware of Missing Link's capability - both from the utility and security standpoints. I've been quietly (and not so quietly) 'pushing' it (or something very similar) for years now. I retired it for a few years while I was still languishing in OS 9... and have only recently reintroduced it. There was one previous OS X capable version, and its mention provoked a huge firestorm of response on another discussion forum at the time. I'm not really interested in defending my motivations for it again... I understand what run-only means and why folks may be leery of any offering they can't read before use. But I can't read much more than AppleScript and HTML (both in simplest forms), so I wouldn't likely use _any_ third party apps if I took the same approach. Anyways... Peter B. ----- |
Quote:
on examination, I think I understand the basic mechanism you use, and I think I see how to duplicate it if I wanted. if I'm right, it's no more virulent than any other app, if people use common sense and standard precautions (though I suggest you take the security section of your read me and paste it at the top of the document rather than burying it at the bottom). but still... |
tw wrote:
>>on examination, I think I understand the basic mechanism you use, and I think I see how to duplicate it if I wanted. if I'm right, it's no more virulent than any other app -- In basis... AppleScript... Standard Additions... since OS 7.6... 8.1? Though it may not have sounded like it, I appreciate the input from this thread. ML is still 'a work in progress' and I have never known whether to bury it deep or hawk it freely ('unimpaired') as shareware. Most folks are so busy running away from anything like ML that they won't even comment. I'm used to it... or should be by now. I remain undecided about ML's eventual fate, but I've been at something similar since '98. No reason to get in a hurry now. That's all (for today) folks. It's Mother's Day, and I've got phone calls to make. Peter B. ----- |
Quote:
As others have said, if you think that Missing Link is taking advantage of a security hole in OS X, you have a duty to inform Apple. However, I think it is likely that things are working as designed - that there is no security hole. If a malicious person can get someone to install arbitrary software, then it's already game over. So no need to worry about what holes might be opened up by your software - instead just warn the users in clear language about the risks. And making your software open source is a good way to make sure that there aren't security holes in it due to something you've overlooked. |
hayne:
Thanks for your thoughts... Again, ML is still on the drawing board, and I make no representation that it is 'finished'. If I get to that point, I might very well like review and evaluation by a 'trusted person or persons'. But - lord knows - they're hard to find these days. -- BTW, is it my lousy dialup connection, Safari, or this implementation of PHP that frequently cuts threads short? It happens a lot here at OS X Hints. PB ----- |
Just to beat up this thread a little more...
The updated version of Missing Link 'promised' above is now available at: http://www.mhtc.net/~bunnz/scriptlink.html and... http://scriptbuilders.net/files/missinglink2.3b2.html -- I would welcome feedback from folks who can make it break... or breach the basic security safeguards it now offers. I doubt it's yet bulletproof, but it's coming along... Thanks. Peter B. ----- |
You could always make a php exec to call the applescript via osascript this works but please note this is a huge security issue
You have to save the script so it is run only <?php shell_exec("osascript -l open /Library/Webserver/Documents/yourapplescript.scpt'"); ?> but this should only be used if the server it is running on is not connected to the world only local secure intranet, if you really have to do it. |
t-k, how would you use the php call from a button
|
Quote:
|
I thought that what was required, to run a script on local machine
|
Quote:
I.e. it is like Google supplying a web page that has a link on it that runs a script on your local machine. |
| All times are GMT -5. The time now is 05:50 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.