Make your Xojo app react to Applescript

Is there a way to respond to Applescript commands?

for example, if there was an Applescript:

tell application "MyApp"
set a to URL of current tab of first window
end tell

http://documentation.xojo.com/api/language/app.htmlleEvent

@Thomas Tempelmann wrote a tutorial on how to make a Xojo application scriptable. http://www.tempel.org/RB/AppleEvents

In recent documentation that I’ve read from Apple (so take with a pinch of salt), they no longer recommend Apple Script and are advising developers to find alternative functions.

I’m seeking some clarification from Apple regarding their “updated” documentation on using Apple Script from a Sandboxed application, because it looks like they’ve deprecated the ability for a Sandboxed application to call Apple Script.

The other ways to add this functionality to your application (which Apple now uses for their System Preferences) include URL Aliases and commandline instructions. Both are doable from a Xojo application (ironically URL Aliases uses Apple Events underneath).

Thanks all.