AppleScript - Check if Entourage is running, If so Quit

Hello All,

I’m sure this is a simple problem for many of you but I’m not sure how to approach it. I am trying to create a script that will check to see if Entourage is running. If so, it will quit Entourage. I’ve got the part of the script that will Quit Entourage (saving any open windows). What I can’t seem to figure out it how to check if Entourage is running - then (if so) quit Entourage then go to next step. Or, if Entourage is not running go on to the next step.

My ultimate goal is to use this in a backup routine. So, after Entourage is quit, the script will run chmod set it so that Entourage can’t be launched. Then use hdiutil to create a backup .dmg of the Microsoft User Data (just the Entourage Data). Once hdiutil is complete I will need to use chmod to change permissions on Entourage so that it can be launched (Important). And finally, I would like to put a prompt on the screen stating that the backup is complete. This Script will need to run nightly (2am) and overwrite the previous nights backup. I intend to cron or anacron.

In and ideal world I would like this all to begin with a prompt that would allow the user to defer the execution until a later time. If the user does not respond in x number of seconds or minutes the script executes.

Any help with any of this will be greatly appreciated . I have done extensive research on the tools I’m using (hdiutil vs. ditto vs. etc…) and found hdiutil to have the greatest potential for meeting the task. Also, the work patterns of the users have made other means of backup (commercial or otherwise) unacceptable.

Thanks again.

tell application "Finder"
	if (name of every application process) contains "Entourage" then
		return true
	else
		return false
	end if
end tell

If that doesn’t work, turn on entourage and run this code in script editor to locate the ‘actual’ name of entourage and plug it in in the place of “Entourage” in the first bit of code…

tell application "Finder"
	set currProcesses to name of every application process
end tell

j