Solved! (The 'magic number' below is due to a bug in ASObjc stuff).
on applicationDidFinishLaunching_(aNotification)
-- Insert code here to initialize your application before any files are opened
-- Register the URL Handler stuff
tell current application's NSAppleEventManager's sharedAppleEventManager() to setEventHandler_andSelector_forEventClass_andEventID_(me, "handleGetURLEvent:", current application's kInternetEventClass, current application's kAEGetURL)
-- all your other application startup stuff..
end applicationDidFinishLaunching_
-- handler that runs when the URL is clicked
on handleGetURLEvent_(ev)
set urlString to (ev's paramDescriptorForKeyword_(7.57935405E+8)) as string
tell me to log "urlString: " & urlString
-- do stuff with 'Set AppleScript's text item delimiters to "foo="', and then "&" etc, to parse your parameters out of the URL String
end handleGetURLEvent_
And your info.plist needs to be in the form:
<key>CFBundleIdentifier</key>
<string>com.myappname</string>
...
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>My App Name Helper</string>
<key>CFBundleURLSchemes</key>
<array>
<string>myappscheme</string>
</array>
</dict>
</array>
Which allows your app to take input from URLs in the form:
myappscheme://com.myappname/?foo=stuff&bar=otherstuff
The whole URL is passed in and and ends up in your 'urlString' variable, so you can parse it however you like. Which means you don't even necessarily have to follow the standard URL conventions like I have above, but you might find it convenient to do so, so that potentially you can support parsing let's say Facebook or Google Maps URLs in your app with a simple change of http:// to myappscheme://
Enjoy/Hope that helps.. :)