Xol.app : Direct Link to Language Documentation

I found this, and it seems to work:

declare function NSClassFromString lib “Cocoa” ( inName as CFStringRef ) as Ptr
declare function sharedApplication lib “Cocoa” selector “sharedApplication” ( classRef as Ptr ) as Ptr
Dim myApp as Ptr = sharedApplication( NSClassFromString( “NSApplication” ) )
declare sub activateIgnoringOtherApps lib “Cocoa” selector “activateIgnoringOtherApps:” ( appRef as Ptr, flag as boolean )
activateIgnoringOtherApps( myApp, True )

See post #33 from Albin Kiland:
https://forum.xojo.com/t/solved-set-app-to-frontmost-app-for-app-in-mas

Ciao

2 Likes