Insuring (idiot-proofing) a macro by using "if application is running"

As a quick footnote, the JavaScript for Automation version of AppleScript's is running idiom is the .running() method on the Application interface, so:

if (Application('TaskPaper').running()) {
    // ...
}

For reference, the full set of methods on the Application class (shown here in the Safari debugger) is:

2 Likes