AppleScript and Remote Applications

I’m trying to write a script that checks to see if FMP6 Unlimited is up and running on our xServe and if not launches the program and databases that need to be opened on it.

I can get the databases to open by launching them with/in the Finder but how do I determine if FMP6U is up and running - if it’s down I want it to try the launch sequence and then send me and a few other people a message telling us it was down and what the results of the try were - successfull, not successfull.

I tried this:

using terms from application “Finder”
tell application “Finder” of machine “eppc://macadministrator:m3r10nr00t@kopxserv01.local”
return processes
on error errMsg
display dialog errMsg
end try
end tell
end using terms from

but I get an error:

Cannot get process on host

Any help would be appreciated

The Finder didn’t return the processes. This is the System Event application’s job:

tell application "System Events" of (get machine "eppc://macadministrator:m3r10nr00t@kopxserv01.local")
	using terms from application "System Events"
		if process "FMP6" exists then
			display dialog "The FMP6 is now running on remote machine"
			display dialog "The FMP6 is stopped on remote machine"
		end if
	end using terms from
end tell

Actually it’s not.

I may quote Matt Neuburg “The processes class is grandfathered into the Finder”

Although it’s not documented you are able to get the processes list asking the Finder (which asks System Events).

Another problem is that System Events isn’t running by default and your script causes an Application isn’t running error.

Interesting, thanks. But I found first time such code, now. :frowning: