We’ve maintained backwards compatibility where we could, but there’s a lot of changes.
Here’s some notes direct from our primary AppleScript developer about what you should be aware of as you update your OmniFocus scripts.
(Please feel free to start new threads with specific scripting questions.)
-
AppleScript is supported only in the Pro edition of OmniFocus.
-
Our rich text class is now called
rich text
instead 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:-
Apple apps:
- Xcode.app
rich text
/'ricT'
- AppleScriptKit.framework
rich text
/'ricT'
- iChat
rich text
/'rtfx'
- Mail
rich text
/'ctxt'
- Aperture
rich text
/'ctxt'
- TextEdit uses
scriptSuite
/scriptTerminology
and ends up withtext
/'ctxt'
- Xcode.app
-
AppleScript related apps:
- Script Debugger.app
rich text
/'ricT'
- FastScripts.app
rich text
/'ctxt'
- Script Debugger.app
-
Omni apps (already changed via OmniStyle.sdef):
- OmniPlan
rich text
/'ctxt'
- OmniFocus
rich text
/'ctxt'
- OmniPlan
-
Other apps:
- Scrivener
rich text
/'ctxt'
- PDFpen
rich text
/'ctxt'
- VoodooPad
rich text
/'rtfx'
- Adium
rich text
/'ricT'
- Acorn
rich text
/'ctxt'
- Scrivener
-
-
In order to work with application sandboxing,
file
orPOSIX file
must 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
file
property must be specified. -
The
name
ofdocument
s is 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 name
property of thefile attachment
must be afile
orPOSIX file
due to sandboxing. -
The
autosave interval
property ondocument
has been removed. -
The
value
property on theattribute
class now returns ageneric color
record for color-typed attributes. This is a record with specific components, including alpha (with numeric components ranging from 0 to 1). -
The
regexp
argument of thereplace
command has been namedregular expression
and 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
select
command has been removed. Instead theadd
,remove
, andset
commands can be used to update theselected trees
element. -
Added the
pbcopy
,pbpaste
andpbsave
commands to copy items to and from the pasteboard. -
The
library
andinbox
properties have been removed from thesidebar tree
class. -
The
document window
class now has aselected sidebar tab
property. -
The
selected view mode identifier
property ondocument window
is gone, replaced by theselected sidebar tab
property. Theavailable view mode identifiers
property is also gone as the available list of tabs is described by the type of theselected sidebar tab
property. -
The
available smart group identifiers
andselected smart group identifier
properties onsidebar tree
don’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
import
command has been replaced by theimport into
command, which specifies the destination document explicitly. Additionally, this now takes afile
typed parameter for thefrom
argument. -
The
parse tasks
command has been replaced by theparse tasks into
command, which specifies the destination document explicitly. -
The code for
default value
on the style attribute class has changed from ‘OSdv’ to ‘OFdv’. Scripts using this terminology may need to be recompiled.