I will be working on a script that will make a backup copy of Quark docs when saved. We work off a MacOSX server that lost its entire RAID when the drives were hot-swapped…DOH. o:o:o:o:o:o
On top of that, I want the script to monitor Photoshop, Illustrator and other applications.
Right now, I just copy the entire Customer job folder to my local drive. After it gets full, I run Chipmunk.app to compare my folder to our Archive folder for duplicates and wipe out all duplicates in my backup folder with one click. (Our Archive folder is a holding place full of subfolders of each DVD we burn from closed jobs. Once the jobs are burned to DVD, I don’t need my local copy.)
The problem is that I don’t need to copy all the art, fonts, etc. that could easily be rebuilt from the customer’s disks/ftp downloads. I just need the new stuff I did to fix their files.
We have 6 prepress people that work off the same server where all open jobs are in a master folder named “Active Jobs”.
I would hate to scan the entire folder for ownership set to me. I would rather have an automator function on that folder which would monitor all subfolders for just my new stuff and copy it off.
But rather than just copy each piece of art into a bottomless pit backup folder, I want it to recreate the original folder structure i.e. JOBNUM CUST:ART:pic01.tif. I don’t want a bunch of tif/jpg,eps files dumped in one gi-normous folder.
So it will be a lot of trial and error/testing/more testing.
If anyone would want to collaborate submit ideas, feel free to respond back.
I wonder if I could just get the script to monitor my selected applications when they save a file. Kinda like how Suitcase monitors and activates fonts?
This would be more immediate than scanning/searching the Active Jobs folder.
Here is something that I have been playing with recently (no real testing yet) The idea was to sync local work folders to server work folders and vice versa when working on collaborative projects. As pidge1 has already stated you should look up the man pages for “rsync” for your options. I wanted some extra GUI stuff adding to mine. Its worked with some basic testing although I may not have it properly error trapped (still in the early days yet).
set Def_Loc to path to desktop
--
tell application "Finder"
set The_Screen to desktop's window's bounds
set {W, H} to {item 3 of The_Screen, item 4 of The_Screen}
end tell
--
my UI_Enabled()
--
if the result is not false then
activate me
set Input_Folder to choose folder with prompt ¬
"Choose the directory you want to Sync from?" default location Def_Loc without invisibles
set Output_Folder to choose folder with prompt ¬
"Choose the directory you want to Sync to?" default location Def_Loc without invisibles
--
my RSync("-auvE", Input_Folder, Output_Folder)
--
if the result is not false then
delay 1
my New_Window(Input_Folder, {0, 44, ((W / 2 - 1) as integer), H})
my New_Window(Output_Folder, {((W / 2) as integer), 44, W, H})
end if
end if
--
on RSync(Options, Source, Destination)
try
do shell script "rsync" & space & Options & space & ¬
quoted form of POSIX path of Source & space & ¬
quoted form of POSIX path of Destination
on error Error_Message
display dialog Error_Message giving up after 6
return false
end try
end RSync
on New_Window(This_Folder, The_Bounds)
tell application "Finder"
activate
set Window_1 to make new Finder window to This_Folder at front
try
tell Window_1 to set {current view, toolbar visible, bounds} to {list view, false, The_Bounds}
end try
my Bounds_Bug(Window_1, The_Bounds)
try
select every item of Window_1
my Key_Stroker("Finder", (ASCII character 29), {option down})
reveal item 1 of Window_1
select {}
end try
end tell
end New_Window
on Bounds_Bug(Window_Ref, The_Bounds) -- I think a Tiger bug x & y item pairs switching
tell application "Finder"
if bounds of Window_Ref = ¬
{(item 2 of The_Bounds) + 1, ¬
(item 1 of The_Bounds) + 1, ¬
(item 4 of The_Bounds) + 1, ¬
(item 3 of The_Bounds) + 1} then
try
tell Window_Ref to set bounds to ¬
{(item 2 of The_Bounds), ¬
(item 1 of The_Bounds), ¬
(item 4 of The_Bounds), ¬
(item 3 of The_Bounds)}
end try
end if
end tell
end Bounds_Bug -- end bug work around
on Key_Stroker(The_Process, The_Key, The_Mods)
tell application "System Events"
if exists process The_Process then
tell application process The_Process
if The_Mods is {} then
keystroke The_Key
else
keystroke The_Key using The_Mods
end if
end tell
else
-- error "Process " & The_Process & " is not active!"
end if
end tell
end Key_Stroker
on UI_Enabled()
tell application "System Events"
repeat until UI elements enabled is true
get properties
if UI elements enabled is false then
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.universalaccess"
display dialog "UI element scripting is not enabled." & return ¬
& "Check \"Enable access for assistive devices\"" & return ¬
& "or \"Exit\" to Exit Script." buttons {"Exit"} ¬
default button 1 giving up after 3
if button returned of result = "Exit" then
quit
return false
exit repeat
end if
end tell
end if
delay 6
end repeat
return true
end tell
end UI_Enabled