Is there a way to tell if my application was activated by AppleScript?
ie, I have the following AppleScript
tell application "MyApp"
activate
end tell
Is there a way I can tell it was AppleScript and not a User manually clicking on the app to activate it?
//func applicationDidBecomeActive(_ notification: Notification)
//or
func applicationDidFinishLaunching(_ aNotification: Notification) {
switch someLaunchMethod {
case .click:
print("user clicked")
case .applescript:
print("activated from AppleScript")
}
}