I have an application that I use for billing that stores all of its information in a folder inside "Application Support" in the user library folder. ? While the application doesn't support multiple users, I have enabled multiple users by creating a temporary folder and moving the database files back and forth when "switching" users.
The main data folder is called "Billings". ? I've created a folder for temporary data called "Billings Data". ? In the billings data folder, there are two folders for the actual data: "Billings Bari" and "Billings Blue".
So, I need either an Apple script or automator script application that does the following:
1. checks to see if the "Billings" application is open. ? If it is, asks me to close it manually, then waits for a response like "did you close it?" and checks again before moving forward.
2. checks to see which "user" is live. ? This will be done based on which of the two data folders have data in them .... if "Billings Bari" has stuff in it, then the user Blue is in use... if "Billings Blue" has stuff in it, then the user Bari is in use.
3. tells me via a dialogue box which user is in use, and asks me if I'd like to switch users.... "The current user is Blue. ? Would you like to switch to Bari?" or "The current user is Bari. ? Would you like to switch to Blue?". ? Waits for a response yes or no.
4. If yes is selected:
If the user Blue is in use....
Move all data in the Billings folder to the Billings Data\Billings Blue folder.... then move all the data in the Billings Data\Billings Bari folder to the Billings folder.
If the user Bari is in use....
Move all data in the Billings folder to the Billings Data\Billings Bari folder.... then move all the data in the Billings Data\Billings Blue folder to the Billings folder.
If no is selected... the script does nothing, and exits.