Problems processing multiple folders

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

Moderator: Mr_Noodle

Problems processing multiple folders Sun Jun 21, 2009 5:22 pm • by learned
I can't seem to get subfolder processing to work.

I have a rule defined:

If Kind is Folder > Run Rules on Folder Contents

I then have a second rule defined:

If name matches s•dup > Move file to folder TRASH.

•dup is defined as a token: (digit)(digit)(digit)-(digit)(digit)-(digit)

where I am trying to delete files such as s123-23-1.jpg

Any ideas?
learned
 
Posts: 29
Joined: Sun Jun 21, 2009 5:18 pm

Re: Problems processing multiple folders Sun Jun 21, 2009 6:47 pm • by Mr_Noodle
How does it look in the preview? If it's not matching there then there is some logic problem. If it does match there but doesn't do what you want when you run it, then check the logs to see if there was an error during execution. Go to the "Info" tab and click on "View Log". Let me know what you find there.
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Problems processing multiple folders Sun Jun 21, 2009 7:04 pm • by learned
The subfolders rule matches, but I'm seeing nothing in preview about file matches within the folders. Will preview show matches at the subfolder level?

I moved some of the files I am trying to delete up to the parent folder level and preview matches them now. They still are not deleting when I run rules however and the log appears empty with regard to the execution.
learned
 
Posts: 29
Joined: Sun Jun 21, 2009 5:18 pm

Re: Problems processing multiple folders Mon Jun 22, 2009 12:50 pm • by Mr_Noodle
Yes, in general, preview should show matches throughout the file tree. There is a bug now (fixed in the beta - details in the beta forum) where preview will not work properly with rules that use the "Subfolder Depth" attribute.

Otherwise, are you using any other conditions or rules? It doesn't seem right if the files match at the top level but not in a subfolder. As for the logs, I suggest turning on debug mode as described here: viewtopic.php?f=4&t=296
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Problems processing multiple folders Mon Jun 22, 2009 7:14 pm • by a_freyer
I've had a similar problem, and this is how I fixed it:

I believe you're missing is the ".jpg" or the anything flag (...) after the last (digit) in your matching string. The result would look like this:

•dup is defined as a token: (digit)(digit)(digit)-(digit)(digit)-(digit)(...)


or

•dup is defined as a token: (digit)(digit)(digit)-(digit)(digit)-(digit).jpg


I have found that sometimes Hazel won't match if you don't include file extensions or wildcards in place of file extensions. It might have something to do with hidden vs. visible extensions, but I don't know.
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

Re: Problems processing multiple folders Wed Jun 24, 2009 12:54 pm • by Mr_Noodle
If you match against the "Name" attribute, it shouldn't include the extension. "Full Name" does include the extension though.
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Problems processing multiple folders Mon Jul 06, 2009 10:19 am • by wifinetguy
I'm having a similar problem and can't figure out how to fix it. I'm using Yep to scan new files into my Mac (Leopard). Yep places new files into the following directory structure: /username/Documents/Yep Documents/Year/Month/new_doc_just_scanned.

I'm trying to get Hazel to just monitor the last folder (month) and when a new file gets put there it processes it based on the rules I specify. However, I can't get Hazel to notice when a file gets placed in the current month's folder. My Hazel rules are monitoring the "Yep Documents" folder. Can someone give me some help on how to get this to work?

Thanks very much in advance.
wifinetguy
 
Posts: 7
Joined: Thu Mar 13, 2008 1:03 pm
Location: Virginia, USA

Re: Problems processing multiple folders Mon Jul 06, 2009 11:53 am • by a_freyer
It sounds like there are a few solutions here.

The easiest would be to make sure that your rules for the "documents" folder are being applied to subfolders. By default, Hazel does not navigate folder structures. So, adding a rule like this would work:

(1) [Subfolder Rul] If (kind = folder) then (Run rules on subfolder)

So, for every folder in "documents", Hazel will run the non-folder rules on its contents. From there, I would advise also adding a rule to ignore older files:

(2) [Ignore Old Files] If (kind is not folder) and If (Created Date is NOT within last 30 Days) then (ignore file)



Alternatively you could navigate folder structures only when the date matches the folder.
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

Re: Problems processing multiple folders Mon Jul 06, 2009 5:32 pm • by Mr_Noodle
Hazel won't immediately detect files as they are placed in a subfolder. There may be a delay. Otherwise, follow a_freyer's advice in terms of having Hazel descending into subfolders. You may also want to add a condition concerning subfolder depth so you have rules only apply to files in the month folders. See the sticky article in this forum concerning subfolders.
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Problems processing multiple folders Mon Jul 06, 2009 7:56 pm • by wifinetguy
Thank you both for the suggestions. I appreciate your quick responses.
wifinetguy
 
Posts: 7
Joined: Thu Mar 13, 2008 1:03 pm
Location: Virginia, USA


Return to Support