How to set a further action on sorted sub-folders

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

Moderator: Mr_Noodle

I have set up a "Downloads" folder with the following rules:

1) Set label colour for new files.
2) Remove label colour for files after 2 days.
3) Sort files into sub folders by Kind after 1 week.

I don't want the first 3 rules to operate on the Hazel created folders, but would like the following actions to take place :

4) On the created sub-Folders
5) Move to trash anything that is not a dmg, zip or tar file after 4 weeks.

I am not sure how to go about this?
If using extension matching, can you enter some form of regex like dmg|zip|tar

Thanks
hadleyhope
 
Posts: 5
Joined: Wed Aug 29, 2007 5:41 pm

Wed Aug 29, 2007 11:40 pm • by Mr_Noodle
As for not operating on the created folders, you'd have to find some pattern to filter on for those folders. Kind is a pretty limited list so you could even try enumerating them all.

You can then set up a rule to descend into subfolders (see the FAQ or search the forums). As for the multiple extensions, you can do as follows:

"If extension is not dmg and extension is not zip and extension is not tar and date added is not in the last 4 weeks, move to trash"

Let me know if you need any more help.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thu Aug 30, 2007 1:57 pm • by hadleyhope
i am a still a bit confused!

I have modified the rule that will create the sub folders to call them "Hzl-<KIND>"

I have read the help on sub folders but am a bit confused, Do I have to have all actions in the rule that states process rules on sub folder?

If not does Hazel run the rules below the run on sub folder rule only on sub folders, or does it run *all* rules for folder on the sub folder?

So what I want is:
1) Colour newly added files
2) Remove colour for files no longer newly added
3) Sort old files into sub folders
4) Only the sub folders whose name starts with Hzl-
4a) Do stuff
4b) Maybe do more stuff

I guess what I want is a rule whose action is run this sub set of rules on those items that pass the rules conditions...

Thanks Martin
hadleyhope
 
Posts: 5
Joined: Wed Aug 29, 2007 5:41 pm

Thu Aug 30, 2007 3:29 pm • by Mr_Noodle
The "Run rules on folder contents" just operates on the folder. What happens is that it goes into that folder then goes through the whole rule list again.

As a result, you should craft your rules to not operate on files you don't want it to. For instance, you could add a tag when you move a file into a subfolder and then exempt it from the other rules by looking for that tag.

Using your example, it could be something like:

1) If newly added and comment is not "filed"
2) If no longer newly added and comment is not "filed"
3) Sort into subfolders, add "filed" to comment
...
4a) Do stuff to files with comment "filed"
4b) Maybe do more stuff to files with comment "filed"

Let me know if that's clear or if you need more explanation.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thu Aug 30, 2007 4:44 pm • by hadleyhope
Thanks, that looks like it will do the trick, I guess it would be nice for Hazel 3 to have simple regex's and a action that would run other named rules.

When I clicked on an existing pattern attribute, I was tring to drag it out of the field I got a couple of sys pref crashes:

Command: System Preferences
Path: /Applications/System Preferences.app/Contents/MacOS/System Preferences
Parent: WindowServer [73]

Version: 3.5 (3.5)
Build Version: 33
Project Name: SystemPrefsApp
Source Version: 1260600

PID: 1880
Thread: 0

Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_INVALID_ADDRESS (0x0001) at 0x8b0875ab

Thread 0 Crashed:
0 libobjc.A.dylib 0x90a594c0 objc_msgSend + 16
1 com.apple.AppKit 0x93837558 -[NSTokenFieldCell _delegateTokensFromPasteboard:] + 371
2 com.apple.AppKit 0x9383707e -[NSTokenFieldCell _tokensFromPasteboard:] + 115
3 com.apple.AppKit 0x9383a896 -[NSTokenFieldCell performDragOperation:] + 499
4 com.apple.AppKit 0x9354907a NSCoreDragReceiveProc + 1091
5 com.apple.HIServices 0x917f917d DoDropMessage + 98
6 com.apple.HIServices 0x917f90ee SendDropMessage + 41
7 com.apple.HIServices 0x917f77ba DragInApplication + 492
8 com.apple.HIServices 0x917f60d3 CoreDragStartDragging + 553
9 com.apple.AppKit 0x9354ee0a -[NSCoreDragManager _dragUntilMouseUp:accepted:] + 730
10 com.apple.AppKit 0x9354e403 -[NSCoreDragManager dragImage:fromWindow:at:offset:event:pasteboard:source:slideBack:] + 1438
11 com.apple.AppKit 0x9354de5b -[NSWindow(NSDrag) dragImage:at:offset:event:pasteboard:source:slideBack:] + 126
12 com.apple.AppKit 0x93714f37 -[NSTextView(NSDragging) dragSelectionWithEvent:offset:slideBack:] + 460
13 com.apple.AppKit 0x9339cd33 -[NSTextView mouseDown:] + 3686
14 com.apple.AppKit 0x9383dfa7 -[NSTokenTextView mouseDown:] + 3590
15 com.apple.AppKit 0x933763c3 -[NSWindow sendEvent:] + 5279
16 com.apple.AppKit 0x93368364 -[NSApplication sendEvent:] + 5023
17 com.apple.systempreferences 0x00007b53 0x1000 + 27475
18 com.apple.AppKit 0x93292dfe -[NSApplication run] + 547
19 com.apple.AppKit 0x93286d2f NSApplicationMain + 573
20 com.apple.systempreferences 0x0000e426 0x1000 + 54310
21 com.apple.systempreferences 0x0000e34d 0x1000 + 54093

Thread 1:
0 libSystem.B.dylib 0x9003f6cf syscall_thread_switch + 7
1 com.apple.AppKit 0x93370682 -[NSUIHeartBeat _heartBeatThread:] + 1399
2 com.apple.Foundation 0x927f52e0 forkThreadForFunction + 123
3 libSystem.B.dylib 0x90024227 _pthread_body + 84

Thread 0 crashed with X86 Thread State (32-bit):
eax: 0x8b08758b ebx: 0x0df598ae ecx: 0x90ab4f48 edx: 0x00000001
edi: 0x93837019 esi: 0x0e438940 ebp: 0xbfffedf8 esp: 0xbfffedb8
ss: 0x0000001f efl: 0x00010282 eip: 0x90a594c0 cs: 0x00000017
ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037

Binary Images Description:
0x1000 - 0x17fff com.apple.systempreferences 3.5 /Applications/System Preferences.app/Contents/MacOS/System Preferences
0x2f9000 - 0x2f9fff com.yazsoft.SDEnhancer ??? (1.0) /Users/Martin/Library/InputManagers/SpeedDownload Enhancer/SpeedDownloadEnhancer.bundle/Contents/MacOS/SpeedDownloadEnhancer
0xdf14000 - 0xdf73fff com.noodlesoft.Hazel 2.0.1 (346) /Library/PreferencePanes/Hazel.prefPane/Contents/MacOS/Hazel
0x8fe00000 - 0x8fe4afff dyld 46.12 /usr/lib/dyld
0x90000000 - 0x90171fff libSystem.B.dylib /usr/lib/libSystem.B.dylib
0x901c1000 - 0x901c3fff libmathCommon.A.dylib /usr/lib/system/libmathCommon.A.dylib
0x901c5000 - 0x90202fff com.apple.CoreText 1.1.2 (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreText.framework/Versions/A/CoreText
0x90229000 - 0x902fffff ATS /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS
0x9031f000 - 0x90774fff com.apple.CoreGraphics 1.258.77 (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics
0x9080b000 - 0x908d3fff com.apple.CoreFoundation 6.4.7 (368.28) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x90911000 - 0x90911fff com.apple.CoreServices 10.4 (???) /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices

Apart from that all is well!

Thanks Martin
hadleyhope
 
Posts: 5
Joined: Wed Aug 29, 2007 5:41 pm

Tue Sep 04, 2007 2:44 pm • by Mr_Noodle
Thanks for the crash report. Is this happening with regularity and can you replicate it at will or was it a one-time deal? Also, are you running 2.0 or 2.0.1?
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Tue Sep 04, 2007 3:01 pm • by hadleyhope
Running 2.0.1

Yes does happen with some regularity, I had a sort into sub folders action, first added a kind attribute to the pattern, then clicked to the left of the added attribute to enter some free text, then tried to either; drag the kind attribute to the left of the added free text, or drag the kind attribute back into the attribute container.
hadleyhope
 
Posts: 5
Joined: Wed Aug 29, 2007 5:41 pm

Tue Sep 04, 2007 3:49 pm • by Mr_Noodle
Hmm, I'm not able to replicate it on my end. I'm tweaking stuff in that area to fix some other bugs so email me if you get a chance.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Tue Sep 04, 2007 4:21 pm • by hadleyhope
Mr_Noodle wrote:Hmm, I'm not able to replicate it on my end. I'm tweaking stuff in that area to fix some other bugs so email me if you get a chance.


Nor can I now, before a reboot it was happening nearly every time. It seems stable now, before the attribute would not move around in the pattern field (if dragged) and the "plus" cursor did not appear if it was dragged back to the attribute container.
hadleyhope
 
Posts: 5
Joined: Wed Aug 29, 2007 5:41 pm

Tue Sep 04, 2007 7:36 pm • by Mr_Noodle
Oh well. Let me know if it happens again.

And you can't really drag attributes back. It's like a palette. If you want to get rid of one, select it and hit delete (treat it like just another character).
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support