Mirror Tagged Folder Contents in Dropbox?

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

Moderator: Mr_Noodle

Mirror Tagged Folder Contents in Dropbox? Sun Mar 19, 2023 6:47 am • by noisyneil
Hi. I wonder if Hazel might be the tool for this...?

I have a Smart Folder in the Finder that contains a number of project folders which have been tagged to indicate they are in currently in progress.

Within each project folder will be one or more .m4a audio files. These are the current work-in-progress versions of each project and I'd like these all to be copied to one dedicated Dropbox folder.

If a project folder is then untagged (and thereby removed from the Smart Folder), I'd like its copied audio files to be removed from the Dropbox folder.

It seems like Hazel might be the tool for this, but I suspect Keyboard Maestro might be needed for the file removal part...

Any thoughts or alternative ideas are welcome. Thanks in advance.
noisyneil
 
Posts: 10
Joined: Sun Mar 19, 2023 6:06 am

Re: Mirror Tagged Folder Contents in Dropbox? Mon Mar 20, 2023 10:01 am • by Mr_Noodle
Hazel won't be able to process the removal if it's individual files. If you, instead, sync the folder containing those files over, then that would reflect the state of whether the files are there or not.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Mirror Tagged Folder Contents in Dropbox? Mon Mar 20, 2023 10:33 am • by noisyneil
Mr_Noodle wrote:Hazel won't be able to process the removal if it's individual files. If you, instead, sync the folder containing those files over, then that would reflect the state of whether the files are there or not.


Thanks for the reply. I'd be happy to do the removal part manually, so do you think the copy part might be possible?
noisyneil
 
Posts: 10
Joined: Sun Mar 19, 2023 6:06 am

Ok I've made some progress with this:

https://forum.keyboardmaestro.com/t/pro ... u=noisneil

There's one missing piece of the puzzle. Is there a condition that will detect if the file/folder count has gone up/down? I want to use Hazel to trigger a Keyboard Maestro macro whenever the number of files in the Smart Folder is reduced (i.e. one or more files or folders have been un-tagged).
noisyneil
 
Posts: 10
Joined: Sun Mar 19, 2023 6:06 am

If the smart folder is the folder being monitored by Hazel, then you can't really create rules to apply to the smart folder itself. Rules only apply to the items inside the folder being monitored. Is having the smart folder match the folders containing these files not a possibility?
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Mirror Tagged Folder Contents in Dropbox? Tue Mar 21, 2023 10:04 am • by noisyneil
Mr_Noodle wrote:Is having the smart folder match the folders containing these files not a possibility?


Not sure what you mean by "the smart folder match the folders"...?
noisyneil
 
Posts: 10
Joined: Sun Mar 19, 2023 6:06 am

Set up the parameters so that the smart folder results are the folders containing the files, not the files directly. Not sure how doable it is but is worth looking into.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Mirror Tagged Folder Contents in Dropbox? Wed Mar 22, 2023 10:01 am • by noisyneil
That's already how I have it set up:

https://forum.keyboardmaestro.com/uploa ... 70c674.png

The folders are tagged and appear in the Smart Folder. I'd like to trigger an AppleScript if anything is untagged and therefore the number of items in the Smart Folder is reduced.
noisyneil
 
Posts: 10
Joined: Sun Mar 19, 2023 6:06 am

Number of items in the smart folder directly or in the subfolders?
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Directly.
noisyneil
 
Posts: 10
Joined: Sun Mar 19, 2023 6:06 am

Then it won't work. The rules are for items inside the folder being monitored, not for that folder itself.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Ah ok. Thanks for the clarification.

Does this mean I could monitor the Smart Folder's parent folder instead? If so, how do I trigger a routine when an item (in this case the Smart Folder) decreases in size?
noisyneil
 
Posts: 10
Joined: Sun Mar 19, 2023 6:06 am

I'm not sure if Smart Folders have any metadata attribute for the number of items in it. You can try and test it but I have my doubts.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Mirror Tagged Folder Contents in Dropbox? Mon Mar 27, 2023 10:33 am • by noisyneil
How would you do it if it wasn't a Smart Folder but a regular one?
noisyneil
 
Posts: 10
Joined: Sun Mar 19, 2023 6:06 am

Hazel has a Sub-file/folder count attribute which you use against folders. I don't know if that works with Smart Folders though. There is a similar Spotlight attribute which, again, not sure if it works with Smart Folders.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Next

Return to Support