New Omni Automation API available for looking up Omni Automation API as TypeScript declarations

This week, we’ve updated our public test builds of OmniFocus 4.9, OmniGraffle 8.0, and OmniOutliner 6.3. Among all the other changes, the Omni Automation API release notes point out this little change:

  • API Lookup — Added Application.getTypeScriptDeclarations(), so humans and tools can search the Omni Automation API for classes that have matching API or documentation. Calling app.getTypeScriptDeclarations() will return all available API.

What this means is that both humans and tools now have a way to ask these apps for their current API documentation, returned in TypeScript form with embedded comments describing those APIs.

osascript -e 'tell application "OmniFocus" to evaluate javascript "app.getTypeScriptDeclarations();"'
osascript -e 'tell application "OmniGraffle" to evaluate javascript "app.getTypeScriptDeclarations();"'
osascript -e 'tell application "OmniOutliner" to evaluate javascript "app.getTypeScriptDeclarations();"'
4 Likes

If you want to get even more meta, try:

app.getTypeScriptDeclarations("getTypeScriptDeclarations");
1 Like