Applescript Support in OF4

Hi

Is there no AppleScript support in OF4? My scripts are not working.

Is there shortcuts that I should use (in which case if someone can point to the appropriate docs). Otherwise, I will try to move to the new Omniscript platform.

Agni

Scripting is supported in the Pro version only.

hmm… On OF3 I had pro and I am trialing a pro version right now. Pls lmk if I am missing something. When I look at Omnifocus dictionary in scriptEditor it is just not there.

Has anyone got AppleScript to work in OF4?

Has anyone got AppleScript to work in OF4?

I’m no longer using any AppleScripts (they’ve all been replaced by Omni Automations), but I did install an AppleScript (specifically, Verify Next Actions Exist), and it worked as expected in OmniFocus 4.

Specifically, I chose Help > Open Scripts Folder and moved the AppleScript to this folder. I then chose View > Customize Toolbar and added the AppleScript to the toolbar. Finally, I clicked the toolbar item to run the AppleScript.

It’s possible that some AppleScripts no longer work in their current form, but I can confirm the mechanism for running AppleScripts is still in place in OmniFocus 4.

1 Like

Thanks. Let me try.

Also I have written to their support as you recommended on another thread.

1 Like

If both OF3 and OF4 are on your system, existing scripts may still be targeting the earlier application. Try this, for example, in Script Editor (with the language selector at top left set to AppleScript):

tell application "OmniFocus"
	id
end tell

The result will show you the bundle id of the application which is being targeted by default, and should read:

"com.omnigroup.OmniFocus4"

Setting the language selector at the top left of Script Editor to JavaScript rather than “AppleScript”, I am finding that this script successfully copies the OF4 selection in (untagged) TaskPaper format:

Copy a section of omnifocus tasks in taskpaper format with tags removed - TaskPaper - Hog Bay Software Support


Notice that near the top it specifies the OF version:

Application("com.omnigroup.OmniFocus4")

If your scripts are in .scpt (i.e. compiled) format, you may need to test them in a plain text (.applescript) format and then Save As to new .scpt files to recompile them.

1 Like

Thanks everyone.

Between uninstalling OF3 and upgrading OF to one of the point releases AppleScript started working.

1 Like

I found I had to move my scripts from the OF3 folder to OF4 in ~\Library\Application Scripts.