I have a LiveCode application that, as part of a larger goal, checks that the name of the βvery firstβ application (ie the name on the menu bar). I have a livecode to run this through the shell:
osascript -e 'tell application "System Events" to return name of every process whose frontmost is true'
It works fine when the application runs as a normal process, but when it is launched using launchctl as a daemon, it does not work. I get an error
61:68: Syntax error: expected class name, but identifier found (-2741).
As I said, this only happens when the application is running as a daemon. Any ideas why?
btw: OS X 10.7.4
source share