Thank you for the suggestion. I see my mental model of operations was off a bit. The file notification events do not trigger actions directly, rather they initiate Hazel's execution of rule sets.
So, I created two new rule sets. One triggered on last modified and on triggered on size change. So there are now 3 rules sets for image optimization, plus the subdirectory rule set. I found I had to place the new rule sets (#1 & #2) before the original rule set (#3)--not really sure why this is since its actions were not triggered. (It looks like a simple match is enough to terminate rule processing.)
Rule set 1: Optimize Images (Last Modified)
IF Kind is image AND name does not end with ".tmp" AND Date Last Modified is after Date Last Matched
THEN Run the bash script AND send a notification.
Rule set 2: Optimize Images (Size)
IF Kind is image AND name does not end with ".tmp" AND Size did change
THEN Run the bash script AND send a notification.
Rule set 3: Optimize Images [unchanged]
IF Kind is image AND name does not end with ".tmp"
THEN Run the bash script AND send a notification.
Rule set 4: Run rules on Subfolders [unchanged]
TESTS
- Copied an image using Finder (Cmd-C, Cmd-V). Rule set 3 triggered.
- Modified and saved the image using Pixelmator. Rule set 1 triggered.
- Deleted the modified image and copied from the original again. No rule sets triggered (of course Date Last Modifed is now before Date Last Matched, but Size changed).
- Retried #3. Still no rule sets triggered.
- Hazel then began reprocessing all 1000+ images files (because I changed the rules?); so I waited for the reprocessing to finish and tried steps 1-4 again. This time everything worked.
So, adding the new rules accomplished my goals and there appears to be a "stabilization period" after rules are changed.
Thanks again for your help. I'll keep testing.
R/Scott G. Ainsworth