System Events 'not running'
System Events 'not running'
- Subject: System Events 'not running'
- From: "Jacopille, David" <email@hidden>
- Date: Fri, 02 Nov 2018 21:44:01 +0000
- Thread-topic: System Events 'not running'
Sorry for the saga – but this is driving me insane. I have a beer for any guru
that can tell me what is going on. A good beer. I will find a way to get it
to you.
After upgrading to OS X Server 10.12 our osascript launched Applescript’s
randomly error with “Application ___ isn’t running”… the application in the
first tell statement in the script.
We checked, and the application was running. Even if it wasn’t, the scripts
all had activate commands.
I thought System Events might be able to sort things out, because it knows
which applications are running. So we added a small function to tell
application “System Events” to validate the application is or isn’t running.
That pushed the problem to System Events, which errored with: “Application
System Events isn’t running”. System Events definitely has a pid.
Restarting the machine fixes the problem, but it comes back quickly and we
would have to restart dozens or hundreds of times a day. So I thought, maybe
System Events gets hosed occasionally, but keeps running. So I kill -9 and
relaunch System Events.
Half the time we still get the “Application System Events isn’t running” after
the first kill. So I made a loop outside of Applescript that keeps killing
System Events, relaunching it on the command line, validating it has a good
pid, and running a one liner tell to application “System Events” something…
until it stops responding with “Application System Events isn’t running.”
If System Events was just hosed then it should work on the second try. Often
we stay in the loop, killing System Events repeatedly until eventually it stops
erroring out. Once that error stops, the original script we were trying to run
works fine.
What is making the determination to throw the error “Application System Events
isn’t running”?
I get the feeling that the problem is with the parsing the scripts, which are
built on the fly as text, before running in osascript. Whatever parses the
text needs to get the dictionaries of the apps mentioned in the AppleScript.
If the applications in the tell statements, or any process or tool that’s part
of getting the dictionaries, was so hosed it could not respond, the lack of
response could be interpreted as the application isn’t running.
I thought System Events was the tool that helped with that. But if System
Event’s can return the same error message… what process is putting that message
together?
I’m ready to kill-strangle-destroy -9 that process.
Thanks,
Dave Jacopille
Boston
MFS Email system made the following annotation
---------------------------------------------------------------------------------------------------------------------------------------
This email communication and any attachments may contain proprietary,
confidential, or privileged information. If you are not the intended recipient,
you are hereby notified that you have received this email in error and that any
review, disclosure, dissemination, distribution or copying of it or its
contents is prohibited. The sender does not waive confidentiality or any
privilege by mistransmission. If you have received this email in error, please
notify the sender immediately, delete this email, and destroy all copies and
any attachments.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden