Error in Javascript match

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

Moderator: Mr_Noodle

Error in Javascript match Sun Jan 25, 2015 11:51 pm • by rjames86
I've been playing around with some Javascript actions and seem to be running into issues.

As a very simple test, I had a "Passes Javascript" embedded as

Code: Select all
return true


I've also tried loading an external script as

Code: Select all
function hazelMatchFile(theFile, inputAttributes)
{
    return true
}


The preview error returns

[<ComNoodlesoft_HazelFileData ... > valueForUndefinedKey:]: this class is not key value coding-compliant for the key javaScript

When force running the rule, the following is returned in Console.app

2015-01-25 19:48:03.532 hazelworker[93376] Error while matching rule New Rule2 against file /Users/path/to/photo/2015-01-24 11.23.09.jpg: [<ComNoodlesoft_HazelFileData 0x7fafb8c6c720> valueForUndefinedKey:]: this class is not key value coding-compliant for the key javaScript.
2015-01-25 19:48:03.533 hazelworker[93376] ###main load address: 0x102337000
2015-01-25 19:48:03.533 hazelworker[93376] ###Noodle load address: 0x102447000
2015-01-25 19:48:03.533 hazelworker[93376] ###CK load address: 0x10240d000
2015-01-25 19:48:03.533 hazelworker[93376] (
0 CoreFoundation 0x00007fff96bdf64c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff988936de objc_exception_throw + 43
2 CoreFoundation 0x00007fff96bdf1e9 -[NSException raise] + 9
3 Foundation 0x00007fff8d2f35ed -[NSObject(NSKeyValueCoding) valueForUndefinedKey:] + 226
4 hazelworker 0x0000000102368141 hazelworker + 201025
5 Foundation 0x00007fff8d210e68 -[NSObject(NSKeyValueCoding) valueForKey:] + 385
6 Foundation 0x00007fff8d24ffc5 -[NSFunctionExpression expressionValueWithObject:context:] + 1089
7 Foundation 0x00007fff8d24fa9c -[NSComparisonPredicate evaluateWithObject:substitutionVariables:] + 243
8 hazelworker 0x000000010239e014 hazelworker + 421908
9 hazelworker 0x000000010239e10c hazelworker + 422156
10 hazelworker 0x000000010239ccf9 hazelworker + 417017
11 hazelworker 0x00000001023a7c9f hazelworker + 461983
12 hazelworker 0x000000010239b260 hazelworker + 410208
13 hazelworker 0x000000010236f63f hazelworker + 230975
14 hazelworker 0x000000010233e618 hazelworker + 30232
15 hazelworker 0x000000010233fe73 hazelworker + 36467
16 hazelworker 0x0000000102341ea3 hazelworker + 44707
17 libdyld.dylib 0x00007fff8fc365c9 start + 1
18 ??? 0x0000000000000003 0x0 + 3
)

Using the "Run Javascript" for actions has been working from what I can tell.
rjames86
 
Posts: 7
Joined: Mon Mar 10, 2014 9:38 am

Re: Error in Javascript match Mon Jan 26, 2015 2:14 pm • by Mr_Noodle
Thanks for that. I can replicate it here so I'll look into it and hopefully have a fix in the next patch.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Error in Javascript match Thu Jan 29, 2015 3:48 pm • by rjames86
Great. Much appreciated!
rjames86
 
Posts: 7
Joined: Mon Mar 10, 2014 9:38 am


Return to Support