Sort into domain subfolders

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

Moderator: Mr_Noodle

Sort into domain subfolders Tue Jul 15, 2014 11:08 pm • by crcastle
I've been using (and loving) Hazel for a few years and just saw this new app: http://downloadorganizerapp.com/ Sounded useful, and then I thought, "hey, Hazel can probably do that!".

So I'm testing it out and trying to sort my downloads from the month of May in to a domain folder for each file. Here's the Hazel rule: http://cl.ly/image/0v110a2H020x

This is working for most files, but I've run in to a few cases where it doesn't work as expected. For example: http://cl.ly/image/1F0w2j1i1S3i You can see that Torpedo-1.2.2.app.zip didn't get sorted to a domain folder, but I can see a Where From URL when I Get Info on that file.

It looks like the Where From property on the file is an array, meaning a file can be from multiple URLs. I have several files (like Torpedo-1.2.2.app.zip in the screenshot above) that seem to have a valid URL for the first item in the array and then an empty string for the second item in the array. Here are the detailed properties of Torpedo-1.2.2.app.zip: http://cl.ly/image/3h0Y0H2Y1b2D (see the bottom) I'm not sure how the array got like this. I use Chrome beta for all my web browsing, so it was possibly set by Chrome.

When Hazel processes this file, I get the following error in the Console:
Code: Select all
2014-07-15 19:30:23.076 hazelworker[93880] Processing folder 2014-05 (forced)
2014-07-15 19:30:25.272 hazelworker[93880] Torpedo-1.2.2.app.zip: Rule Archive Downloads into source folders matched.
2014-07-15 19:30:25.273 hazelworker[93880] [Error] Sorting into subfolder failed: Could not move /Users/crcastle/Downloads/2014-05/Torpedo-1.2.2.app.zip. Source and destination are the same.
2014-07-15 19:30:25.312 hazelworker[93880] Done processing folder 2014-05


I think what's happening here is that Hazel is trying to put this file into a subfolder named after the second item in the array, which is an empty string.

What is the logic Hazel uses to select an item from the array to use as a folder name? Can Hazel give the user more control over which item is chosen? At the very least can Hazel use a different item in the array if it hits an empty string (or some other invalid folder name value)?

Thanks!

-Chris
crcastle
 
Posts: 3
Joined: Tue Jul 15, 2014 10:42 pm

Re: Sort into domain subfolders Wed Jul 16, 2014 12:40 pm • by Mr_Noodle
I'll look into that. Usually the last item is the most recent so Hazel chooses that. Not sure why an empty entry is stuck in that list.

Alternatively, instead of Source Domain, you can use the "Where from" attribute directly. If you click on it, there are options to select the first or last item.
Mr_Noodle
Site Admin
 
Posts: 11866
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Sort into domain subfolders Wed Jul 16, 2014 12:43 pm • by Mr_Noodle
Oh, and also, you may want to file a bug with the Chrome team to fix that.
Mr_Noodle
Site Admin
 
Posts: 11866
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Sort into domain subfolders Wed Jul 16, 2014 6:24 pm • by crcastle
Thanks! I checked out using Where From directly, but it looks like I can't cut that down to just the domain. It gives me the entire URL.

Also I'll see if I can repro the issue in Chrome and file a bug with them.

Choosing the second one makes sense most of the time, for sure. But regardless, since Hazel (or me or you) don't have control over applications misusing this property or using it in an unexpected way, it would be awesome if Hazel could handle this more defensively.

Here's another example of that property being used in a different way -- and by Apple!

Where From property from a picture a contact sent me via iMessage (Messages.app): http://cl.ly/image/1l2w222C3e16
crcastle
 
Posts: 3
Joined: Tue Jul 15, 2014 10:42 pm

Re: Sort into domain subfolders Thu Jul 17, 2014 11:22 am • by Mr_Noodle
I'll look into fixing it for the blank case though in the case with Messages, I'd need to think about it. I'd need to come up with some way of picking out the most relevant item.
Mr_Noodle
Site Admin
 
Posts: 11866
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Sort into domain subfolders Fri Jul 18, 2014 2:37 am • by crcastle
Thanks, and thanks for Hazel in general. I hate spending time organizing my computer, and love that Hazel can help me automate that. Easily.
crcastle
 
Posts: 3
Joined: Tue Jul 15, 2014 10:42 pm


Return to Support