Page 1 of 1

Issue sorting downloads folder by kind

PostPosted: Sat Jul 21, 2012 5:09 am
by gavnone
Hello,

I just downloaded Hazel after watching Don McAlister preview on his Screenshots Online podcast, and I'm a little stuck on something:

On the podcast, Don was showing how to sort apps in the Downloads folder by "kind" - I setup my rule exactly the way he was showing it ("any file matched", "sort into subfolders by kind") yet, when he did it, his subfolders appeared within his Downloads folder and, when I did it, my subfolders appeared within a folder named "folder" which was, in turn, located in my Downloads folder.

I'm not sure what, if anything, I did wrong - I watched the podcast a second time to verify that I had setup the rule correctly. I'm very confused as to why it worked for Don and not for me. Any assistance will be greatly appreciated.

Re: Issue sorting downloads folder by kind

PostPosted: Sat Jul 21, 2012 9:33 am
by gavnone
Here is the log file of when Hazel ran the "Sort Downloads" rule. For some reason, Hazel created a folder named "folder" and it put my files inside. How do I keep Hazel from creating the "folder" folder?

2012-07-21 06:28:10.763 hazelworker[11868] Folder: Rule Sort Downloads matched.
2012-07-21 06:28:10.789 hazelworker[11868] Error moving file /Users/Matthew B. Howell/Downloads/Folder to /Users/Matthew B. Howell/Downloads/Folder/Folder: -50 - error in user parameter list
2012-07-21 06:28:10.789 hazelworker[11868] [Error] Sorting into subfolder failed: Could not move file /Users/Matthew B. Howell/Downloads/Folder to subfolder Folder.
2012-07-21 06:28:10.796 hazelworker[11868] Done processing folder Downloads

Re: Issue sorting downloads folder by kind

PostPosted: Sat Jul 21, 2012 8:26 pm
by a_freyer
Seems like there is an issue with your subfolder rule trying to create folders with a non-escaped folder path as input. What's the exact rule? Did you use the token as shown in the video?

Re: Issue sorting downloads folder by kind

PostPosted: Sun Jul 22, 2012 5:05 am
by gavnone
This is the syntax I used:

Name: Sort Downloads
All of the following conditions for the file or folder being processed.
Any file.
Sort into subfolder with pattern "kind".
If file exists, rename.

This is the same syntax Don used on his podcast, he was using the unregistered version. I am also using the unregistered version.

Re: Issue sorting downloads folder by kind

PostPosted: Sun Jul 22, 2012 1:12 pm
by a_freyer
Make sure to exclude the filetype "Folder" I'm pretty sure that's what's causing your issues.

Code: Select all

if (all) of the following conditions are met for (the file or folder being processed
    kind is not folder

Do the following to the matched file or folder
    Sort into subfolder with pattern (Kind)
         If file exists, rename.


Hint 1: a little known feature of tokening in Hazel is that you can control the case. Click the white arrow on the right of the token and you can guarantee that it will be Title Case, or lowercase, or ALL CAPS.

Hint 2: For mine 'sort into subfolder' rule I include a (s) after the token so that all of my created folders are named like: Numbers Spreadsheet(s)

Re: Issue sorting downloads folder by kind

PostPosted: Mon Jul 23, 2012 11:47 am
by gavnone
Thank you very much for you assistance with this, adding the "kind is not folder" statement fixed my issue.

Re: Issue sorting downloads folder by kind

PostPosted: Mon Aug 27, 2012 9:54 pm
by Gasport
I had the exact same problem tonight when I was trying to duplicate the rule. I am new so I do not have great an understanding of tokens but Don did not seem to be using any nor did he exclude folders as you mention.

In any event, I tried to duplicate your logic and did not find an eloquent way of doing it. I finally got to a point where I excluded the folder by using a nested if and came out with this.

If all of the following conditions are met for the file or folder being matched:
Any File

"if all of the following conditions are met the current file or folder"
"Kind is not Folder"

This worked and I am assuming this is what you meant.

Re: Issue sorting downloads folder by kind

PostPosted: Tue Aug 28, 2012 4:57 pm
by Mr_Noodle
Just delete the "any file" condition. If you have any other conditions in the same rule, that condition is redundant and will only serve to confuse the issue. Just do as a_freyer did, which is the "Kind is folder" condition by itself.

Re: Issue sorting downloads folder by kind

PostPosted: Wed Aug 29, 2012 10:44 am
by Gasport
Thanks, you are very helpful as usual.