Hazel: 3.3.1 (1200)
For a items in a folder I want achieve this logical behavior in Hazel:
Don't apply rule actions until I quit iTunes
I have a rule with this "Passes AppleScript" condition:
- Code: Select all
if application "iTunes" is running then
return false
else
return true
end if
Easy, if iTunes is running Hazel will avoid apply actions to files. Ok, but what will do Hazel with these files when quit iTunes? nothing??.
I think that Hazel understand that files have been processed by the rules correctly although actions have not been applied (return false). Exists a law that say "if a file matches the same rule it matched last time, it will not re-run its actions", maybe this law apply here?
If instead I apply this Applescript code:
- Code: Select all
if application "iTunes" is not running then
return true
end if
In this code Hazel don't have "return false" and when iTunes is active the script give an error (normal). Maybe this error causes that Hazel re-evaluate the situation in next Hazel cycle for all files? If in the next Hazel cycle iTunes is closed the rules will apply actions on files as expected?
What is the clean way to do that Hazel re-evaluate automatically all files against rules when iTunes is not launched?
Note1: If i pause / un-pause monitored folder Hazel re-evaluate all files against rules again and all works, but is not a solution due to I must do it manually every time.
Note2: I had wait more than 20 minutes in every test to look if Hazel do something in their cycles.
A screencast with an example: https://dl.dropboxusercontent.com/u/122 ... -44-28.mp4
Log of this screencast:
- Code: Select all
Marcador - 31/10/2014 10:43:25
2014-10-31 10:45:01.886 HazelHelper[9196] DEBUG: Deploy folders: (
"<ComNoodlesoft_HazelConcreteFolder: 0x7f8f15b26390> \"Applescript\""
)
2014-10-31 10:45:01.887 HazelHelper[9196] DEBUG: Thread 0x7f8f13c29690: FOLDERS SYNCED: (
"<ComNoodlesoft_HazelConcreteFolder: 0x7f8f13f7f030> \"Applescript\""
)
2014-10-31 10:45:03.346 HazelHelper[9196] DEBUG: Thread 0x7f8f13c29690: Run worker for folder: /Users/edenexposito/Desktop/Applescript
2014-10-31 10:45:03.376 hazelworker[52596] ###main load address: 0x10a2a3000
2014-10-31 10:45:03.377 hazelworker[52596] ###Noodle load address: 0x10a3b2000
2014-10-31 10:45:03.377 hazelworker[52596] ###CK load address: 0x10a37a000
2014-10-31 10:45:03.390 hazelworker[52596] DEBUG: Program is licensed.
2014-10-31 10:45:03.396 hazelworker[52596] DEBUG: Unexpected type for Mail download URL: (null)
2014-10-31 10:45:03.404 hazelworker[52596] DEBUG: Could not find entry for default_directory in Chrome preference file.
2014-10-31 10:45:03.410 hazelworker[52596] Processing folder Applescript (forced)
2014-10-31 10:45:03.410 hazelworker[52596] DEBUG: Initialized
2014-10-31 10:45:03.410 hazelworker[52596] DEBUG: Pausing to wait for things to settle down.
2014-10-31 10:45:05.510 hazelworker[52596] DEBUG: Processing directories: (
"/Users/edenexposito/Desktop/Applescript"
)
2014-10-31 10:45:05.512 HazelHelper[9196] DEBUG: Checking events for path /Users/edenexposito/Desktop/Applescript, folder <ComNoodlesoft_HazelConcreteFolder: 0x7f8f15b26390> "Applescript"
2014-10-31 10:45:05.513 hazelworker[52596] DEBUG: Received file event: {
date = "2014-10-31 09:45:03 +0000";
path = "<ComNoodlesoft_NoodlePathSet: 0x7fa6ea502f20> - (\n \"/Users/edenexposito/Desktop/Applescript\"\n)";
}
2014-10-31 10:45:05.513 hazelworker[52596] DEBUG: About to process directory /Users/edenexposito/Desktop/Applescript
2014-10-31 10:45:05.514 hazelworker[52596] DEBUG: .DS_Store: File is hidden/invisible. Skipping.
2014-10-31 10:45:05.538 hazelworker[52596] DEBUG: documento.pdf: Did not match any rules.
2014-10-31 10:45:05.538 hazelworker[52596] DEBUG: Directory /Users/edenexposito/Desktop/Applescript processed in 0.024997 seconds
2014-10-31 10:45:05.538 HazelHelper[9196] DEBUG: Checking events for path /Users/edenexposito/Desktop/Applescript, folder <ComNoodlesoft_HazelConcreteFolder: 0x7f8f15b26390> "Applescript"
2014-10-31 10:45:05.539 hazelworker[52596] DEBUG: Sending metrics to scheduler. Next scheduled run:
2014-10-31 10:45:05.540 HazelHelper[9196] DEBUG: Received metrics for folder /Users/edenexposito/Desktop/Applescript: {
directoryDepth = 0;
requestedSchedulingTime = "";
triggerPaths = "<ComNoodlesoft_NoodlePathSet: 0x7f8f13d9f660> - (\n)";
unavailablePaths = "{(\n)}";
}
2014-10-31 10:45:05.540 HazelHelper[9196] DEBUG: Timer scheduled for folder /Users/edenexposito/Desktop/Applescript at
2014-10-31 10:45:05.540 hazelworker[52596] Done processing folder Applescript
2014-10-31 10:45:05.544 HazelHelper[9196] DEBUG: Thread 0x7f8f13c29690: Task removed: [52596]
See this in log:

