Hello Scriptcoders
Is there anyone who can help me out.
I’m looking for a script that may never quit. Even by a person or system
error. Actually a script that checks every 5 min if the app is running.
If it’s not running… The script launch the app again.
In my case it’s easytransfer 4 pro.
The app is running under OS 9.2 on iMac.
I hope one of you can help me out or at least give me a start how I
should make this script.
There is already a alias in startup items of the program.
This is the path where the app is located.
V5/sagem/file transfer/easytransfer 4 pro
TIA
M - Macobrain
– Save this as an application and it will run until you activate it again.
– Nothing can keep an application from quitting (that I know of), however this will reactivate it if it quits.
set App2KeepOpen to application “Internet Explorer” – set this to the application you want to keep running
tell application “Finder”
activate – make the Finder the active app
set FoundIt to false
set ImUp to false
set Path2Me to (path to me) as string – get FilePath of this app
set AppleScript’s text item delimiters to “:”
set MyAppName to text item -1 of Path2Me – get name only of this app
set AppleScript’s text item delimiters to “”
end tell
repeat until ImUp is true – keep doin’ it until you make this app active again
tell application “Finder” to set RunningApps to (name of every process) as list --get a list of all running processes
repeat with x from 1 to count of items in RunningApps --loop with App count
if (front application) as string is MyAppName then --if it's this app then set the ImUp flag
set ImUp to true
exit repeat --bail this loop if ImUp
end if
--if ImUp is true then exit repeat
if item x of RunningApps is (name of App2KeepOpen) then --if it's
set FoundIt to true
exit repeat
end if
end repeat
if FoundIt is false then tell App2KeepOpen to activate -- if your app is not in the list, activate it
delay 1 --take a breath
end repeat
error number -128
Hello ByteJockey
I have seen you are in the prepress world.
I’m also working in the prepress world.
So to give you something in return…
http://www.prepressure.com/
This is a maybe a usefull for you or maybe your co-workers?
And if you have some trouble or need help related to prepress.
Don’t hesitate to contact me : macobrain at hotmail.com
Kind regards
once again… many thanks
No offense to ByteJockey but here’s my take on it…
…Begin Code… … … … …
property AppNeverQuits : “Textedit” – This is the name of the app as the Finder sees it.
property AppPath : alias “Admin1:Applications:TextEdit.app:” – Change this path to whatever you need.
on idle {} – This is the key to keeping it going.
tell application “Finder”
set RunningApps to name of every process whose name is AppNeverQuits – Get a list of programs running and see if your app is in it.
if RunningApps = {} then – If it’s not there, the list is empty…
open AppPath – open it
end if
end tell
return 30 – Check every 30 seconds. Change as needed.
end idle
…End Code… … … … …
Save this out as an applet with the “Stay Open” option checked. every 30 seconds it will check for the app and fire it up if it’s not running. Hope this works as well for you.
BTW, your site is one I have used and often point people towards when they need so good prepress reading. Cheers, BLUEFROG[/i]