Script for backing up user data (Entourage) - CROSSPOST

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 trigger this script using cron, anacron, or launchd (in Tiger).

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.

Any help will be greatly appreciated.

sorry only had time to write this up but should help

tell application "System Events"
	set allProcessors to name of every process as string
	if allProcessors contains "Entourage" then
                --PUT YOUR SCRIPT HERE
	end if
end tell

You could even ask System Events a more direct question:

tell application "System Events" to set quitEntourage to exists process "Microsoft Entourage"
if quitEntourage then
	tell application "Microsoft Entourage" to quit
	(* do any other stuff *)
end if