Tags to denote successful copy

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Tags to denote successful copy Sun Aug 07, 2022 8:10 am • by BobRudge
Here's what I'd like to:

Copy any files placed in a watched folder onto an external drive.
Have some visible way of knowing the copy had happened (eg green label I can see in the Finder. I want to know I can safely delete the original.)
Not have any tag/flag on the file on the external drive. (I don't want the visual clutter on the archive external drive).

I tried using colour flags:
Hazel rule to copy the file and then flag, does not add the flag to the original file, which is what I want.
Rule that flags the file then copies it does not account for when the external is not connected - the original file gets flagged even though it has not been copied.

Can anyone suggest a way I can achieve what I'm looking for please?
BobRudge
 
Posts: 2
Joined: Mon Sep 12, 2011 5:21 pm

Re: Tags to denote successful copy Sun Aug 07, 2022 9:34 am • by AlanRalph
To create a copy of the file on the external drive, you can Sync the file and specify where on the external drive to place the copy. Doing a Tag command afterwards will operate on the original file, not the copy.

Now, regarding how to make sure the rule only runs when the external drive is attached... you'll need to use some AppleScript to work this out. Add a 'Passed AppleScript' condition to your rule, then embed the below code, making sure to specify the name assigned to the external drive:

Code: Select all
tell application "Finder"
   set external_disk to "ExternalDrive"
   return (exists disk external_disk)
end tell


I had to do this recently when moving my music library to an external drive: I needed to make sure music wasn't imported if the drive wasn't connected.

Hope this helps.
AlanRalph
 
Posts: 3
Joined: Fri Mar 18, 2016 10:58 am

Re: Tags to denote successful copy Sun Aug 07, 2022 3:46 pm • by BobRudge
This is amazing. Thank you for taking the time to help me. Works perfectly.
BobRudge
 
Posts: 2
Joined: Mon Sep 12, 2011 5:21 pm


Return to Support