Scripting alternatives for TP3: AppleScript and JavaScript for Applications

Thanks. So, possibly a related question.

I am trying to put 2 and 2 together by running a modified version of @jessegrosjean’s Javascript here:

Basic script to add selected text to TaskPaper 3 “Inbox” - #2 by jessegrosjean

but from the Applescript context using your example above.

Here is a portion of Jesse’s script that I am trying to run from the Applescript context (as a foundation for more to be added):

tell front document of application "TaskPaper"
evaluate script "function(editor, options) {

var TaskPaper = Application('TaskPaper')

}"
end tell

But, I get the following error:

"ReferenceError: Can't find variable: Application


evaluateScript@file:///Applications/TaskPaper.app/Contents/Resources/dist/birch.js:50205:16

Use the Help > SDKRunner to debug"

Is this also an API change, or am I not using evaluate correctly?

In case you are wondering, I am using the Applescript context because this will be a script that runs from within a FileMaker script, and FileMaker only appears to support Applescript at this time.