从 AppleScript 获取 Apple 事件

Get Apple Events from AppleScript

我有一个简单的 AppleScript,它告诉我 url 在特定浏览器中的活动 window

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

但是我希望看到 运行 该脚本需要 Apple Events,可能是其中一些:https://developer.apple.com/documentation/coreservices/apple_events?language=objc 我的最终目标是编写相同的脚本,但使用 Apple 核心服务。

我检查了脚本编辑器,但没有看到显示该信息的任何选项卡或菜单。有什么办法可以翻译那个脚本吗?

提前致谢并问候

是的,有几种这样的方法。我最喜欢使用 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.