System Events Question

Is System Events always running?

After restaring my server and running a workflow it hangs when it gets to a tell block using system events. On my server I wrote a quick script to tell system events to launch then ran my other script again with no error. Then later it did it again I was originally using Finder for this but at the suggestion of others changed it to “System Events”

The ERROR was “The process is not running”
Is system events crashing or does it need to be launched at login?

Thanks,
MT

I assume that this script is running during the restart itself so you don’t know what’s running yet. I assume that your script starts with "activate application “System Events”. If it does and you still get failures, why not just insert a delay at the beginning and see if that helps.

Once again I had to restart my server after a system update. After everything restarted, and the server was up for over 30 min, I opened Activity Monitor set Show to All Processes to find that System Events was not in the list. I ran the script that makes a call to it and sure enough the process was not found. I went and manually launched it and then everything was fine. While this is not really an Applescript issue does anyone have any idea why System Events is not launching at boot time. As a temporary fix I made it a login item but would rather it be a start up item so it is running even if no accounts are logged in.

Thanks,
Mark

System Events is in my Startup Items list without my having put it there, which means some other boot process did. Putting it there yourself should work, however. It’s in /System/Library/CoreServices/

No, Adam, you did it. Assigning any folder action to a folder causes System Events to be loaded (at Startup).
Remove all attached folder actions and it will disappear :wink:

That makes more sense. I knew something was going on.

So if I add it to my login items manually it should stay there even if I don’t have any folder actions set up?

Thanks,
Mark

wouldn’t it be easier to launch System Events explicitly?

tell application "System Events"
launch
...
end tell

I suspect that Enabling access for assistive devices may require System Events as well.

Can I do that to a remote machine?

I’m using this to trigger a script on my server.


	tell application "System Events" of machine "eppc://Pass:Pass@IP_Address"
		if ((get name of the processes) does not contain "Rebuild IF Index-Quick") then
			open file "Server HD:Users:admin:Documents:Studio Scripts:Rebuild IF Index-Quick"
		end if
	end tell

I’m using System Events, instead of Finder as suggested, but this is a problem if System Events is not running.

Can it be launched on the remote machine without using Finder? Otherwise I might as well use Finder in the script anyway since it is always running.

Thanks,
Mark

:lol: talking to applications on a remote machine is a totally different story.
It would have been easier, you had mentioned it in your first post.

Yes, on a remote machine better use the Finder, its directory doesn’t say anything about the class process, but it works.
And you should use this syntax:

tell application "Finder" of machine "eppc://Pass:Pass@IP_Address"
	using terms from application "Finder"
		if ((get name of the processes) does not contain "Rebuild IF Index-Quick") then
			open file "Server HD:Users:admin:Documents:Studio Scripts:Rebuild IF Index-Quick"
		end if
	end using terms from
end tell