Escape the app context to call a global function

I am using “Remote Buddy”. It lets me run applescript code, which apparently runs within RB’s context, i.e. I do not have to use ´tell app "Remote Buddy" to use its own classes and such.
Now, the problem is that I want to invoke the global open location function, but its code <<GURLGURL>> gets translated into the “Get URL” handler that RB itself offers.

How do I write my code so that it accesses the GURL handler on the global scope instead?

You could always try a different tack:

use AppleScript version "2.4" -- Yosemite (10.10) or later
use framework "Foundation"
use framework "AppKit"
use scripting additions

set theURLString to "http://forum.latenightsw.com/t/escape-the-app-context-to-call-a-global-function/693/1"
current application's NSWorkspace's sharedWorkspace()'s openURL:(current application's |NSURL|'s URLWithString:theURLString)
1 Like

Didn’t think of using the ObjC Bridge. Works, but cumbersome.

So, that probably means that AppleScript has no language feature for accessing the parent scope. (such as “super of …”)

A similar situation with PowerMail can be got round by telling any application which doesn’t implement a command using that code to perform it.

tell application "System Events" to open location "http://macscripter.net"

open location, by the way, is in the StandardAdditions.

1 Like