error during rule evaluation

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

Moderator: Mr_Noodle

error during rule evaluation Sun Jun 17, 2012 4:43 am • by dani_w
Hi

For my rules I use Applescript to perform various actions (such as mounting volumes etc.) as part of the rule conditions.

While the scripts work fine when embedded in the rule itself, they produce always "error during rule evaluation" errors when executed from a file (external scripts).
Furthermore, by using external scripts the preview always shows "There is no metadata available for this file" warning, even if the only rule consist of the example script below.

Thanks a lot!
Greetings
Daniel


A simple example script (file) that produces an error:
Code: Select all
on hazelMatchFile(theFile)
   return true
end hazelMatchFile



The associated log entry:
Code: Select all
2012-06-17 10:25:17.680 hazelworker[44099] Processing folder 01test
2012-06-17 10:25:19.723 hazelworker[44099] [Error] Error during rule evaluation: Received error while trying to evaluate rule Test on file foobar
2012-06-17 10:25:19.723 hazelworker[44099] Error while matching rule Connectivity to Synology NAS against file /Users/dani/Documents/Projects/01test/foobar: Error executing AppleScript /Users/dani/Documents/bin/hazel/check_test_script.scpt: <CFBasicHash 0x10065fbc0 [0x7fff76b64fa0]>{type = mutable dict, count = 1,
entries =>
   7 : <CFString 0x7fff76af5940 [0x7fff76b64fa0]>{contents = "OSAScriptErrorNumberKey"} = <CFNumber 0x10065fba0 [0x7fff76b64fa0]>{value = -1708, type = kCFNumberSInt32Type}
}
.
2012-06-17 10:25:19.724 hazelworker[44099] (
   0   CoreFoundation                      0x00007fff8a97cf56 __exceptionPreprocess + 198
   1   libobjc.A.dylib                     0x00007fff902e6d5e objc_exception_throw + 43
   2   CoreFoundation                      0x00007fff8a97cd8a +[NSException raise:format:arguments:] + 106
   3   CoreFoundation                      0x00007fff8a97cd14 +[NSException raise:format:] + 116
   4   hazelworker                         0x0000000100017267 start + 89291
   5   Foundation                          0x00007fff8e0acf39 -[NSCustomPredicateOperator performPrimitiveOperationUsingObject:andObject:] + 46
   6   Foundation                          0x00007fff8e074701 -[NSPredicateOperator performOperationUsingObject:andObject:] + 109
   7   Foundation                          0x00007fff8e073fe8 -[NSComparisonPredicate evaluateWithObject:substitutionVariables:] + 290
   8   Foundation                          0x00007fff8e073a9a -[NSPredicate evaluateWithObject:] + 18
   9   hazelworker                         0x0000000100037f8b start + 223727
   10  hazelworker                         0x0000000100037c90 start + 222964
   11  hazelworker                         0x000000010003d0a7 start + 244491
   12  hazelworker                         0x000000010003752f start + 221075
   13  hazelworker                         0x000000010000278e start + 4594
   14  hazelworker                         0x00000001000036a4 start + 8456
   15  hazelworker                         0x00000001000065cc start + 20528
   16  hazelworker                         0x00000001000015d0 start + 52
   17  ???                                 0x0000000000000003 0x0 + 3
)
2012-06-17 10:25:19.734 hazelworker[44099] Sending metrics to scheduler. Next scheduled run: 2012-06-17 11:25:19.723
dani_w
 
Posts: 3
Joined: Sun Jun 17, 2012 4:30 am

Re: error during rule evaluation Mon Jun 18, 2012 4:01 pm • by dani_w
How embarrassing... :cry:

I saved the scripts with the ".scpt" extension, but as plain text files.

".applescript" extension => plain text
".scpt" extension => binary script files (saved using AppleScript Editor).

OK,... I saved the scripts again and... they worked.

Thanks anyway.
Greetings
Dani
dani_w
 
Posts: 3
Joined: Sun Jun 17, 2012 4:30 am

Re: error during rule evaluation Tue Jun 19, 2012 4:09 pm • by Mr_Noodle
Heh, no problem.
Mr_Noodle
Site Admin
 
Posts: 11267
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support