I poked at this some more. I was able to get my script working (so far) by moving all of the code that required the use of AppleScriptObjC into a Script Library (e.g., to ~/Library/Script Libraries/MyScript.scpt
) and then using it in my Smart Rule script like so:
use script "MyScript"
tell script "MyScript"
doSomethingUsingAppleScriptObjC()
end tell
The key is that the script DEVONthink compiles for use in the Smart Rule does not contain any AppleScriptObjC references itself, only the script in the Script Library.
Maybe this same technique will work for you.