But if there is a problem in the copy action, Hazel will throw up a growl message which only sticks around for a few seconds.
If I am not around when this happens I miss the message or it disappears too soon for me to figure out what file/s could not be copied.
This means I may be missing files and not know, or if I do know, I have to do a compare on the files. Which is not easy because the copies are processed and moved through other systems into a image browsing system.
The simple solution is to use Hazel to Label the index colour of the file and then copy it. example Red. Then after the copy action, re label the index colour. Example Green.
But the second problem is if you use the Copy file Action in Hazel. It will then run all following actions on the copy.
Meaning the original file will always stay Red and the copy will be Yellow. But as I said above I the copy files may have been moved through another system by the time I notice this.
My solution to this was use comments, applescript and the Hazel Switch file property "hazelSwitchFile:" and theFile variable.
I now :
Label the file Red.
Use embedded apple script to get the file path and set it to the files comments.
Copy the file to the destination folder.
Use embedded apple script to:
Get the files comment which will be the path to the Original file (remember i the actions are now working on the copy)
The applescript then switches the file path with , example "hazelSwitchFile: pathFromComment".
Hazel will now process again the original file with any following actions.
So the last action is the re label the files index colour. Example Green.
If the actions did not get past the copy stage, then the file will be labeled 'Red' if i succeeded then it will be 'Green'
Un-labeled the rules did not run on the file.
The Set comment Code:
- Code: Select all
tell application "Finder" to set comment of theFile to ((POSIX path of theFile) as string)
The Get comment/ Switch File Code:
- Code: Select all
tell application "Finder" to set origFile to comment of theFile
return {hazelSwitchFile:origFile}
My copy file stick around long enough for the comments to be read. But I do have script that will write the path out to a file instead. If anyone wants that just ask here.