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?)
Does the script work externally in Script Editor?
Yes both in Script Editor and Script Debugger
Please clarify what you mean by this.
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.
Development would have to comment on this. However, we have some people out on a longer weekend.
Thanks for your patience and understanding.
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.
It’s still not entirely clear to me what’s happening - I think that it might have something to do with caching of helper scripts like mentioned in this thread on Late Night Software’s forum Strange ASObjC Error When Running RegexAndStuff Lib from FastScripts - AppleScript - Late Night Software Ltd.
I’ll investigate further and see if I can track down what’s happening. Thanks for thinking along.