This article documents the changes made over time to the AppleScript support in OmniFocus that you should be aware of as you update your OmniFocus scripts. We try to maintain backward compatibility as much as we can, but sometimes it simply isn’t possible, like with changes made in OmniFocus 2 to support sandboxing.
OmniFocus 3.8
-
Added the
evaluate javascriptcommand to invoke Omni Automation code from AppleScript. -
Added
effectiveDeferDateandeffectiveDueDateas read-only properties on tasks.
OmniFocus 3.6
- Added
should use floating time zoneproperty.
OmniFocus 3.4
-
To resolve a terminology conflict, value strings for the
statusproperty on projects (active/on hold/completed/dropped) are now appended with “status”, e.g. “active” becomes “active status”. -
Added
effectively completedas a read-only property on tasks. -
Added the
mark droppedverb to drop tasks and projects, and added properties fordropped,effectively dropped, anddrop date, which function the same as their “completed” counterparts.
OmniFocus 3.0
-
Added
tagandprimary tagproperties. Where you would previously look up acontextby name, id, or index, you can now use the termtag. Where you would previously get or set thecontextproperty of a task, you can now useprimary tag. You may also use theadd,remove, andmovecommands to manage multiple ordered tags on a task now. -
Added a
deprecated contextproperty to support backward compatibility with scripts using the oldcontextproperty.
OmniFocus 2.12
-
The
completedproperty is now read-only. In order to mark a task or project complete or incomplete, new verbs formark completeandmark incompleteshould be used. -
The
date completedproperty can now only be changed for already completed tasks. -
Added
next defer dateandnext due dateas read-only properties on tasks.
OmniFocus 2.0
-
Our rich text class is now called
rich textinstead oftext, matching other applications on the system. Compiled scripts should continue to work. The AE code is now'OSrt'with an synonym ofctxt. Other apps do other things, for example:App Class Code Apple Event Code Xcode.app rich text'ricT'AppleScriptKit.framework rich text'ricT'iChat rich text'rtfx'Mail rich text'ctxt'Aperture rich text'ctxt'TextEdit text'ctxt'Script Debugger.app rich text'ricT'FastScripts.app rich text'ctxt'Scrivener rich text'ctxt'PDFpen rich text'ctxt'VoodooPad rich text'rtfx'Adium rich text'ricT'Acorn rich text'ctxt' -
In order to work with application sandboxing,
fileorPOSIX filemust be used for saving and opening instead of passing strings as file paths. -
When making a new document with AppleScript (a fairly rare operation, except for our testing scripts), a
fileproperty must be specified. -
The
nameofdocumentis now the display name instead of the last path component (including the path extension). This means that name based lookups need to not include the path extension. Additionally, name based lookups are case- and diacritical-insensitive. -
The
file nameproperty of thefile attachmentmust be afileorPOSIX filedue to sandboxing. -
The
autosave intervalproperty ondocumenthas been removed. -
The
valueproperty on theattributeclass now returns ageneric colorrecord for color-typed attributes. This is a record with specific components, including alpha (with numeric components ranging from 0 to 1). -
The
regexpargument of thereplacecommand has been namedregular expressionand given a new type code so that old scripts using that form will neither compile or execute. The format of this regular expression is now based off the ICU syntax used by Apple’s frameworks. -
The
selectcommand has been removed. Instead theadd,remove, andsetcommands can be used to update theselected treeselement. -
Added the
pbcopy,pbpasteandpbsavecommands to copy items to and from the pasteboard. -
The
libraryandinboxproperties have been removed from thesidebar treeclass. -
The
document windowclass now has aselected sidebar tabproperty. -
The
selected view mode identifierproperty ondocument windowis gone, replaced by theselected sidebar tabproperty. Theavailable view mode identifiersproperty is also gone as the available list of tabs is described by the type of theselected sidebar tabproperty. -
The
available smart group identifiersandselected smart group identifierproperties onsidebar treedon’t map directly to the view settings set up by the interface and are deprecated (marked hidden, but still in the suite). If you need scripting access to the view settings, please let us know what we are trying to accomplish so we can add appropriate access. -
The
importcommand has been replaced by theimport intocommand, which specifies the destination document explicitly. Additionally, this now takes afiletyped parameter for thefromargument. -
The
parse taskscommand has been replaced by theparse tasks intocommand, which specifies the destination document explicitly. -
The code for
default valueon the style attribute class has changed from'OSdv'to'OFdv'. Scripts using this terminology may need to be recompiled.