Created
January 19, 2010 15:53
-
-
Save coreypurcell/281022 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <!-- This file is stored in ~/Library/LaunchAgents --> | |
| <!-- type in terminal: launchctl load ~/Library/LaunchAgents/com.me.photoshop_backup --> | |
| <!-- Or you can log out and log in (launchagents are added automatically) --> | |
| <dict> | |
| <key>Label</key> | |
| <string>com.me.corey.photoshop_backup</string> | |
| <key>LowPriorityIO</key> | |
| <true/> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <string>osascript</string> | |
| <string>/Users/corey/Applications/photoshop_backup.scpt</string> | |
| </array> | |
| <key>StartInterval</key> | |
| <integer>600</integer> | |
| </dict> | |
| </plist> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if appIsRunning("Photoshop") then | |
| tell application "Adobe Photoshop CS3" | |
| try | |
| set theDocument to current document | |
| on error | |
| return | |
| end try | |
| if theDocument is modified then | |
| save the current document in file ("Macintosh HD:Users:corey:Documents:Photoshop:Backup:" & (name of theDocument)) as Photoshop format appending no extension with copying | |
| end if | |
| end tell | |
| end if | |
| on appIsRunning(appName) | |
| tell application "System Events" | |
| if exists process appName then | |
| true | |
| else | |
| false | |
| end if | |
| end tell | |
| end appIsRunning |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment