Making AppleScript URL handlers (WAS: Web browser new-window opener)
Making AppleScript URL handlers (WAS: Web browser new-window opener)
- Subject: Making AppleScript URL handlers (WAS: Web browser new-window opener)
- From: Daniel Shockley <email@hidden>
- Date: Tue, 13 Mar 2001 16:53:26 -0800 (PST)
If you want to make an AppleScript application to use as a URL handler for the Internet control
panel, there are a few things you need to do, some of them involving tools outside of AppleScript.
1. Your script needs to have the following:
-- BEGIN script --
on open location theIncomingURL
-- do stuff with theIncomingURL
end
-- END OF script --
-- Notice that there's no "on run" in the script? The "on open location" call is what allows a URL
to be passed into your applet.
2. You need to give your applet a new creator code so it can be differentiated from all the other
script applets you have. The Internet control panel identifies you URL-handling applet by its
creator code. If you have a bunch of applets, it will lose track of which one to send the URLs to,
since they all have the same creator.
I learned all this while writing Yahoo Mailto Handler. You can download it from
versiontracker.com, or you can read more about it on my website at
http://www.danshockley.com/applescript.html
I hope to make a lot of changes to it when I get the time, and perhaps write more about what I've
learned about making a URL handler and manipulating forms/etc on web pages. If anyone would be
interested in working with me on it, I'd be glad. Would force me to spend time on it. Right now,
the download includes the source code, but does not currently work with Netscape 4.x. Netscape
doesn't properly send the "open location" command. It actually sends an activate command first,
which sets YMH into a different action.
HTH,
Daniel A. Shockley
email@hidden
http://www.danshockley.com
>
Message: 18