Error evaluating conditions

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

Moderator: Mr_Noodle

Error evaluating conditions Tue Mar 10, 2020 5:53 pm • by Sandro
"Error evaluating conditions"
That is what shows when the attached applescript is run for rule evaluation.

When the folder is run, the file in question is simply not matched by any rules. There are no error messages (even with full Debug Mode)

The apple script is as simple as it can be
Code: Select all
on hazelMatchFile(theFile, inputAttributes)
   return {hazelPassesScript:true}
end hazelMatchFile


It is saved as a scpt file

The Security & Privacy Preferences show under Automation:
HazelHelper.app
[x] ABBYY Finereader for ScanSnap.app underneath it

Not sure if that is correct/sufficient

I have tried to reset the TCC via
Code: Select all
sudo tccutil reset all

followed by a restart

Hazel has not prompted me for any permissions after that. It is not showing in the Automation section anymore

Suggestions?
Sandro
 
Posts: 20
Joined: Mon Jul 31, 2017 7:08 am

Re: Error evaluating conditions Wed Mar 11, 2020 10:04 am • by Mr_Noodle
What version of Hazel and macOS are you running? Also, does it behave any differently when use as an embedded script?
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Error evaluating conditions Thu Mar 12, 2020 3:19 pm • by Sandro
It is Hazel 4.4.4 (build 1576)

MacOS 10.14.6 (Mojave)

It does work with the following code in an embedded script
Code: Select all
return {hazelPassesScript:true}


I tried embedded scripts as well before. But the actual code uses the scripting additions (to call a shell script) and another library for regex matching and those don't seem to work in embedded scripts.

I worked on this a few weeks ago and I am pretty certain, that when I left it alone, it worked.
Sandro
 
Posts: 20
Joined: Mon Jul 31, 2017 7:08 am

Re: Error evaluating conditions Fri Mar 13, 2020 11:22 am • by Mr_Noodle
I suggest having the script write out to the log (keep debug mode in Hazel on) so you can try and isolate where it's failing.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Error evaluating conditions Fri Mar 13, 2020 12:34 pm • by Sandro
Mr_Noodle wrote:I suggest having the script write out to the log (keep debug mode in Hazel on) so you can try and isolate where it's failing.


You mean something like
Code: Select all
log "I am here right now"

right?

I should see that output also when only previewing or only when the folder is actually processed?
Sandro
 
Posts: 20
Joined: Mon Jul 31, 2017 7:08 am

Re: Error evaluating conditions Fri Mar 13, 2020 5:10 pm • by Sandro
I have enabled all the logging (Debug Mode, Connection Info and Prediction Info), but I don't see my log message anywhere (it is right behind the start of the handler)

For some reason the rule returns positive now for that file. The preview is still broken, though
Sandro
 
Posts: 20
Joined: Mon Jul 31, 2017 7:08 am

Re: Error evaluating conditions Mon Mar 16, 2020 10:49 am • by Mr_Noodle
Oh, I didn't realize it was only an issue with the preview. It may be some permissions issue with sending AppleEvents. Check the Automation section of the privacy settings.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Error evaluating conditions Thu Mar 19, 2020 5:41 pm • by Sandro
Well... I am not sure

I just noticed in the log, that at some point it says

Code: Select all
2020-03-19 22:14:56.734 hazelworker[63433] DEBUG: Junge.pdf: Did not match any rules.


That is an entry from monitoring the parent folder, which indeed shouldn't match the file anywhere. I just realised that. And further down

Code: Select all
2020-03-19 22:15:00.204 hazelworker[63432] DEBUG: Junge.pdf: Rule signature matched for rule Invoice - Bäckerei Junge. Not executing actions.


I might have gotten that confused at some point.

Let's focus on what I know for sure, because it is happening right now.

* preview fails with an error message (that certainly never worked during all my testing)
* no evidence of any apple script error in the log
* in my testing today, at first the action wasn't executed (see log message above) and now it suddenly was. All I did was copying the rule (and file) over to another folder and toying around there. The original rule in the original folder matches and executes now. If that is confusing to you, it certainly is to me ;-)

Hazel doesn't even appear in the Automation section at all
Sandro
 
Posts: 20
Joined: Mon Jul 31, 2017 7:08 am

Re: Error evaluating conditions Fri Mar 20, 2020 10:46 am • by Mr_Noodle
Note that if you keep copying the same file into the folder, Hazel will not execute the rule on the file as it thinks there is some sort of infinite loop happening. In the logs with debug mode on, you should see messages about the file matching the rule but not executing the actions.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support