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

10.3: AppleScript and Safari clickable link example System
Just noticed this today while perusing the AppleScript area at Apple. I was looking for GUI Scripting to do download and install, but they seem to indicate that GUI Scripting is installed by default in Panther. One thing that I noticed on this page ... there is a little yellow "callout box" with this text:
If you're using Mac OS X version 10.3, click this icon to automatically open the script example in the Script Editor application.
Alogn with the text is a little ApplScript document icon. If you click the icon, sure enough the sample script visible on the web page is opened cleanly in Script Editor. Pretty nifty!

[robg adds: Use the "View Source" feature to see the complex <a href> tag they use to create the clickable icon; it's an interesting example of web / desktop integration.]
    •    
  • Currently 1.29 / 5
  You rated: 2 / 5 (7 votes cast)
 
[20,357 views]  

10.3: AppleScript and Safari clickable link example | 12 comments | Create New Account
Click here to return to the '10.3: AppleScript and Safari clickable link example' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
applescript:// Works under 10.2.8 too!
Authored by: the_webmaestro on Oct 29, '03 12:18:05PM

Actually, I just clicked the link "to see what would happen" and found it launched Script Editor with [code]on UIscript_check()...[/code] in it. I'm running Safari 1.0 (v85.5) under Mac OS X 10.2.8.

---
Father of Jeremy Logan Leeds



[ Reply to This | # ]
applescript:// Works under 10.2.8 too!
Authored by: robJ on Oct 29, '03 02:10:50PM
The protocol will work with the beta version of Script Editor 2. As far as I know, it isn't tied to a particular version of Mac OS. Jonathan Nathan has made available a script that will, among other things, prepare scripts for use with the new the protocol.

Convert Script to Markup Code 2.1.7

[ Reply to This | # ]
applescript:// Works under 10.2.8 too!
Authored by: jonn8n on Oct 30, '03 12:24:09AM

Thanks for the plug, Rob!

Jon



[ Reply to This | # ]
No need to "view source"
Authored by: fm on Oct 29, '03 12:21:22PM

Script Editor's URL Protocol support is detailed here:
http://www.apple.com/applescript/scripteditor/12.html



[ Reply to This | # ]
10.3: AppleScript and Safari clickable link example
Authored by: gaudior on Oct 29, '03 12:27:23PM

Doesn't this 'nifty' feature open the door to the same kind of security exploits that have plagued IE and Outlook Express on Windows for years?



[ Reply to This | # ]
10.3: AppleScript and Safari clickable link example
Authored by: russh on Oct 29, '03 12:41:02PM

Good concern, but it's a non-issue. It doesn't pose the problem because there is no "run script" option.

---
--
russh



[ Reply to This | # ]
10.3: AppleScript and Safari clickable link example
Authored by: DougAdams on Oct 29, '03 02:09:42PM
Look in Services menu under Script Editor if you want the "Run as AppleScript" command :O

Doug
Doug's AppleScripts for iTunes

[ Reply to This | # ]
10.3: AppleScript and Safari clickable link example
Authored by: BMarsh on Oct 29, '03 06:41:23PM

does this mean that a script could be run "remotely" from a web page in this manner?



[ Reply to This | # ]
10.3: AppleScript and Safari clickable link example
Authored by: DougAdams on Oct 31, '03 06:09:11AM
To a degree. Select the following code and click Services > Script Editor > Run As AppleScript (it's not lethal, trust me!):

display dialog "Hello, World!"

You decide to run it. A site can't make something run on your computer. However, I could just as easily post the text of a script that deleted the contents of your hard drive. But it would be up to you to decide to run it from Services.

On the other hand, URL Protocol Scripting, which embeds code in a link, can only be opened in Script Editor as text. The user would have to compile, run it.

This link is the same code as above, but as an URL Protocol Message.

[ Reply to This | # ]
10.3: AppleScript and Safari clickable link example
Authored by: DougAdams on Oct 29, '03 02:06:23PM
I've already started implementing URL Protocol Messaging (there's one now) with example scripts at my iTunes site. They are scattered throughout the site. They work with other browsers as well. It's a System thing.

Doug
Doug's AppleScripts for iTunes

[ Reply to This | # ]
10.3: AppleScript and Safari clickable link example
Authored by: rofl on Oct 30, '03 02:26:42AM

I'm very concerned about security issues too. This is an open door for 'script kiddies', and now they can use an easy language - AppleScript!
Sorry for being paranoid.



[ Reply to This | # ]
10.3: AppleScript and Safari clickable link example
Authored by: Tom Robinson on Oct 30, '03 03:20:28AM
BMarsh and rofl: you need to read the thread. As russh points out, this protocol only supports opening scripts, not running them.

[ Reply to This | # ]