C-Command Software Forum

El Capitan AppleScript/JXA error

I think either the word “looks” or “like” has a special meaning in El Capitan AppleScript, because this no longer works:

set isSpam to looks like spam message theSource

It says “Expected end of line but found identifier.” on “like”

So, I tried converting the script to JXA:

SpamSieve.looksLikeSpam({message: message.source()})

But this gets me “Error -1701: Parameter is missing.”

Any help on either of these avenues is appreciated. Thanks!

That line of script is working for me with El Capitan. Which app are you running the script from? I wonder if it doesn’t have access to read the dictionary file in SpamSieve.app. If so, the raw syntax might work:

set isSpam to «event mtSSisSp» given «class Mess»:theSource

It’s in a “tell app SpamSieve” block within a “tell app Mail” block, but I get the error in just a plain “tell app SpamSieve” block too:

tell app "SpamSieve"
	set isSpam to looks like spam message "hello"
end tell

The application is a command-line Swift application that uses NSAppleScript, but I get the error in AppleScript Editor too. Using the raw Apple Event syntax works though.

Please try installing a fresh copy of the SpamSieve application. Yours might be damaged.