Trouble sorting into subfolders

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

Moderator: Mr_Noodle

Trouble sorting into subfolders Tue Mar 14, 2023 1:40 pm • by BrianBing
I have a rule that takes files put in a folder and then moves them and sorts into successive subfolders. But, lately, perhaps since I've updated to Monterey from Catalina, it's been running into trouble. Sometimes, it'll work fine, but sometimes, it will fail during one of the subfolder moves. Any idea what's going on here or why it's failing?:

Code: Select all
2023-03-14 10:28:12.991 hazelworker[28353] [File Event] File moved: Falcone_GFX_Card_12.mov moved from folder /Users/Editor01/Desktop/Footage & Music Sort/Falcone-FALCONE to folder /Volumes/Development_1.
2023-03-14 10:28:13.008 hazelworker[28353] [File Event] File moved into subfolder: /Volumes/Development_1/Falcone/Falcone_GFX_Card_12.mov sorted from folder /Volumes/Development_1 to subfolder Falcone.
2023-03-14 10:28:13.025 hazelworker[28353] [File Event] File moved into subfolder: /Volumes/Development_1/Falcone/04_GFX/Falcone_GFX_Card_12.mov sorted from folder /Volumes/Development_1/Falcone to subfolder 04_GFX.
2023-03-14 10:28:13.044 hazelworker[28353] Received error set comment for path /Volumes/Development_1/Falcone/04_GFX/02_RENDERS/Falcone_GFX_Card_12.mov: Error Domain=NSOSStatusErrorDomain Code=-10000 "errAEEventFailed" UserInfo={ErrorNumber=-10000, ErrorOffendingObject=<SBObject @0x6000013ebe10: <class 'cobj'> "file:///Volumes/Development_1/Falcone/04_GFX/02_RENDERS/Falcone_GFX_Card_12.mov" of application "Finder" (664)>}
2023-03-14 10:28:13.044 hazelworker[28353] [Error] Sorting into subfolder failed: Could not move file /Volumes/Development_1/Falcone/04_GFX/02_RENDERS/Falcone_GFX_Card_12.mov to subfolder 02_RENDERS.
BrianBing
 
Posts: 3
Joined: Tue Mar 14, 2023 1:33 pm

Re: Trouble sorting into subfolders Thu Mar 16, 2023 9:21 am • by Mr_Noodle
It looks like it's failing when Hazel is trying to re-add the comment to a file. Comments are stored a bit oddly so Hazel does some extra steps to make sure they carry over.

Do the files actually have comments set on them? Also, can you tell me more about the destination folder? Is it on the boot drive or an external/network drive?
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Trouble sorting into subfolders Thu Mar 16, 2023 12:37 pm • by BrianBing
Absolutely. There are comments on the file, which are set earlier in my Hazel rule. The long story is:
I have a folder on my desktop that Hazel is monitoring. It contains various subfolders that the rules are run on. The subfolders are named in a format NAME-ABBREVIATION. For instance "What Would You Do-WWYD". The rule that uses that subfolder to rename the file, appending the ABBREVIATION to the top, and then moves it to a network drive in a folder that matches NAME. And then, depending on some other rules, sorts it into subfolders from there. So, in the above example, a file called "Test.mp4" would be renamed "WWYD_Test.mp4" and then moved to the network drive and sorted into the "What Would You Do" folder.

The reason for setting the comment is I couldn't figure any other way to pass the source folder name into the javascript that splits up the NAME & ABBREVIATION. So, I add a comment with pattern Source Folder and then use that as an inputAttribute on a javascript function to split them apart.

Am I missing an easier way to utilize the source folder name?

Thanks!
BrianBing
 
Posts: 3
Joined: Tue Mar 14, 2023 1:33 pm

Re: Trouble sorting into subfolders Thu Mar 16, 2023 7:08 pm • by BrianBing
I went back to the drawing board and realized there was a much easier way to get the Source Folder name. I just added a nested condition at the top for the enclosing folder, if name matches and created a custom text for anything. Problem solved, no need to add comments thus no problem with comments and everything seems to run smoothly.

Thanks for taking a look at it in the first place!
BrianBing
 
Posts: 3
Joined: Tue Mar 14, 2023 1:33 pm


Return to Support