hazel unarchive and subsort by extension

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

Moderator: Mr_Noodle

hazel unarchive and subsort by extension Thu May 16, 2024 6:17 am • by DMA
I'm trying to use Hazel to watch a folder, and then if a .zip drive is placed there, unarchive that, and subsort it by file extension. Some time later I'd like to be able to some further processing based on the filename, but for the moment I'm just trying to figure out how to unarchive and then process the resultant folder.

My archives are always starting with "OneDrive" and the resulting folder are all named something like "Project 1" or "Project 2".

I was able make some changes to the unarchived folder, but not the contents.

I not after the whole solution (though that would be helpful too!), just a nudge in the right direction would be good as brute force reading the whole manual isn't working, I'm clearly failing to take in nd understand something fundamental here.

Thanks!
DMA
 
Posts: 8
Joined: Thu May 16, 2024 6:11 am

If you want to process files within the created folder, you'll need to tell Hazel to go into subfolders. Look it up in the manual as there's a chapter dedicated to the topic.
Mr_Noodle
Site Admin
 
Posts: 11324
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: hazel unarchive and subsort by extension Thu May 16, 2024 9:43 am • by DMA
I've made progress since I posted but as it was queued I couldn't change the post.

I've been able to unarchive and subsort, but have a couple of issues.

1. Once the files have been subsorted by extension, further processing stops. Attempting to move a just created folder named 'mid' to the trash didn't work. I tried adding various additional 'Go into Subfolders' commands in various places but wasn't able to do this.
Attempting this:
- Unarchive (success)
- sort newly created folder into subfolders based on extension (success)
- move any of above newly creatred folders that are named 'mid' or 'txt' to trash (fail)

2. Sometimes, even though I've tried to edit a rule, I can't save it as the 'save' button is greyed out despite changing/editing some of the parameters.
DMA
 
Posts: 8
Joined: Thu May 16, 2024 6:11 am

Re: hazel unarchive and subsort by extension Thu May 16, 2024 9:57 am • by DMA
Never mind, this is probably a limitation of the trial. I may or may not have read something about those limitations weeks ago. Trial is almost at an end. Pretty frustrating that the trial isn't fully open. Still seems like highly useful software.
DMA wrote:I've made progress since I posted but as it was queued I couldn't change the post.

I've been able to unarchive and subsort, but have a couple of issues.

1. Once the files have been subsorted by extension, further processing stops. Attempting to move a just created folder named 'mid' to the trash didn't work. I tried adding various additional 'Go into Subfolders' commands in various places but wasn't able to do this.
Attempting this:
- Unarchive (success)
- sort newly created folder into subfolders based on extension (success)
- move any of above newly creatred folders that are named 'mid' or 'txt' to trash (fail)

2. Sometimes, even though I've tried to edit a rule, I can't save it as the 'save' button is greyed out despite changing/editing some of the parameters.
DMA
 
Posts: 8
Joined: Thu May 16, 2024 6:11 am

Re: hazel unarchive and subsort by extension Thu May 16, 2024 10:02 am • by DMA
Purchased Hazel and the greyed out 'save' button issue is resolved (maybe put a warning about that on the rule when that restriction is in operation?)

Still can't work out how to trash the newly subsorted sub-folders
DMA wrote:Never mind, this is probably a limitation of the trial. I may or may not have read something about those limitations weeks ago. Trial is almost at an end. Pretty frustrating that the trial isn't fully open. Still seems like highly useful software.
DMA wrote:I've made progress since I posted but as it was queued I couldn't change the post.

I've been able to unarchive and subsort, but have a couple of issues.

1. Once the files have been subsorted by extension, further processing stops. Attempting to move a just created folder named 'mid' to the trash didn't work. I tried adding various additional 'Go into Subfolders' commands in various places but wasn't able to do this.
Attempting this:
- Unarchive (success)
- sort newly created folder into subfolders based on extension (success)
- move any of above newly creatred folders that are named 'mid' or 'txt' to trash (fail)

2. Sometimes, even though I've tried to edit a rule, I can't save it as the 'save' button is greyed out despite changing/editing some of the parameters.
DMA
 
Posts: 8
Joined: Thu May 16, 2024 6:11 am

There shouldn't be a limitation on saving. If it happens again, let me know.

As for your rules, can you post them? You can host screenshots on imgur.com and link them here.
Mr_Noodle
Site Admin
 
Posts: 11324
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: hazel unarchive and subsort by extension Mon May 20, 2024 8:13 am • by DMA
So I have a folder "MyFolder" and have added it as a watched folder to Hazel.

When a zip is added it is successfully uncompressed with this rule:
Image

... and this results in a folder that always looks something to like this for this routine:
Image

Next I ask Hazel to process subfolders:
Image

... and continue with sorting by extension:
Image

... which give me this! Wonderful so far :)
Image

... So now I'd like to move the 'gif' folders to the trash. (This is just a test in the real-world example, there are many folders)

I start by asking Hazel to process subfolders again:
Image

... and a command to move folders named 'gif' the the trash
Image

This doesn't work. I've tried as many variations as I can think of based on what I've read in the documentation.

Perhaps Hazel is only working on one level of subfolder, and I have two. Or something else I've overlooked?

Thanks!
DMA
 
Posts: 8
Joined: Thu May 16, 2024 6:11 am

First off, there is no reason to have multiple subfolder rules. Also, I believe gifs are considered documents so you need to re-order your rules to take that into account.
Mr_Noodle
Site Admin
 
Posts: 11324
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: hazel unarchive and subsort by extension Mon May 20, 2024 9:13 am • by DMA
Thanks!

I'm trying to remove the 'gif' folder and anything it contains.

Image

The folders were created in a previous step, the unarchive of the zip, not sure if that makes a difference.
DMA
 
Posts: 8
Joined: Thu May 16, 2024 6:11 am

Check out the troubleshooting guide here: https://www.noodlesoft.com/kb/hazel-tro ... ing-guide/

The rule status window should be particularly useful in determine how your rules match (or not).
Mr_Noodle
Site Admin
 
Posts: 11324
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: hazel unarchive and subsort by extension Tue May 21, 2024 9:17 am • by DMA
Sorry but those don't seem to help. Am I trying to do something that's not possible? I'm only trying to:
1. Unarchive a zip
2. Sort the contents by extension
3. Delete any folders named "gif"

Given that Hazel treat files and folders the same, the simple rule I've set should be ok I would have thought. What on earth am I missing?!

Image

The logs aren't that helpful, not that I know what to look for? They certainly don't mention my rule above specifically.

Code: Select all
2024-05-21 14:06:09.916 hazelworker[42544] Folder_027: Rule Go into Subfolders matched.
2024-05-21 14:06:09.920 hazelworker[42544] psd: Rule Go into Subfolders matched.
2024-05-21 14:06:09.950 hazelworker[42544] png: Rule Go into Subfolders matched.
2024-05-21 14:06:09.952 hazelworker[42544] jpg: Rule Go into Subfolders matched.
2024-05-21 14:06:09.955 hazelworker[42544] gif: Rule Go into Subfolders matched.


I'm not being obtuse here – to me it looks like it's simply not carrying out my request to move to trash any files/folders named 'gif', where there clearly is one in one of the subfolders it's matching.
DMA
 
Posts: 8
Joined: Thu May 16, 2024 6:11 am

The rule status as well as the logs should show that the gif folder is matching the subfolder rule. The first rule to match is the one that gets executed. You need to re-order your rules or tweak the conditions to account for that.
Mr_Noodle
Site Admin
 
Posts: 11324
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: hazel unarchive and subsort by extension Thu May 23, 2024 7:11 pm • by DMA
I don't see the issue. There's a folder named gif and it's not being deleted. What am I missing?

Simple question. Can hazel do this?

Unzip a zip file.
Sort the result by extension.
Delete any folders that were created that were named 'gif'?

What am I missing?
DMA
 
Posts: 8
Joined: Thu May 16, 2024 6:11 am

You have a rule higher up in the list that matches all folders. That includes the gif folder. Because of that, it never gets to the gif rule.
Mr_Noodle
Site Admin
 
Posts: 11324
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron