macosapplescriptmacos-carbonappleevents

Get Apple Events from AppleScript


I have a simple AppleScript which tells me url of active window in specific browser

tell application "Opera"
   get URL of active tab of window 1
end tell

However I would like to see Apple Events needed to run that script, probable some of these: https://developer.apple.com/documentation/coreservices/apple_events?language=objc My final goal is to code same script but using Apple Core Services.

I have checked Script Editor but I do not see any tab or menu where that information is displayed. Is there any way to translate that script?

Thanks in advance and regards


Solution

  • Yes, there are several such ways. My favorite is to use Script Debugger, which just translates the AppleScript into raw Apple events for you. Alternatively, you can run your AppleScript in an environment where export AEDebugSends=1; export AEDebugReceives=1 has been turned on.