I’ve built a quite complicated AppleScript which also links to a helper script using some AppleObjC functions (use framework Foundation). The script works fine from Script Debugger. But has shown erratic behavior when using it as external script in a smart rule. Sometimes it error’s that some AppleObjC functions can’t be ‘understood’ - while it sometimes works again when restarting DEVONthink.
I’ve tried numerous times, until I figured out that I could try to use it as an ‘internal’ script with Smart Rules, rather than a (compiled) external script. Now it works without a problem.
I’m a bit stumped however how compiling external Applescripts with Smart Rules work. Is there something I should be aware of to make them work (e.g. leave DT to compile them, rather than have Script Debugger compile them?)
I got the impression that compiling the script in Script Debugger and then starting DT made a difference from not-compiling (only saving) the script before starting DT. But as said: I have no idea if this even makes sense. I’m just stumped that my script works as an internal AppleScript, but not as an external Applescript.
At least for DEVONthink that doesn’t make a difference. Hard to tell whether it’s an issue of the script, of AppleScript or of DEVONthink without the source.