View Single Post
Rooting around for the setting which stores the user's definition of "soon", as in OF > Preferences > "Due Soon" is in the next N days, I was kindly guided towards the document.settings collection, which you might broadly use as follows:

Code:
tell application id "com.omnigroup.omnifocus"
	tell default document
		set soon to (current date) + ((value of setting id "DueSoonInterval") as integer)
	end tell
end tell
Although the settings collection does not currently respond to a request for "every setting", I find that you can still list the available document.settings using System Events. The full list of settings turns out, at the time of writing, to be:
InboxIsActive
OFMProcessCompletedInboxItems
OFMTaskDefaultSequential
OFMDefaultSingletonProjectPersistentIdentifier
OFMAutomaticallyHideCompletedItems
OFMRequiredRelationshipToProcessInboxItem
PerspectiveOrder
ProjectInfoReviewRepetitionString
OFMNamedObjectHierarchicalNameSeparator
DefaultDueTime
OFMCompleteWhenLastItemComplete
ContextModeShowsParents
ReminderCalendarAlarmIndex
ReminderCalendarExportEnabled
DueSoonInterval
Code:
property pToClipBoard : "Place in Clipboard"

property pstrOFSettingsPList : "OmniFocus.app/Contents/Frameworks/OmniFocusModel.framework/Resources/Info.plist"

set strFullPath to (POSIX path of (path to applications folder) & pstrOFSettingsPList)

tell application "System Events"
	tell contents of property list file strFullPath
		tell property list item "OFRegistrations"
			tell property list item "OFMSetting"
				set lstName to name of property list items of property list item "defaultSettings"
			end tell
		end tell
	end tell
end tell

set text item delimiters to return
set strNames to lstName as string
set text item delimiters to space

set strButton to button returned of (display dialog strNames buttons {pToClipBoard, "OK"} ¬
	with title "Available OmniFocus document settings")

if strButton = pToClipBoard then tell application id "com.apple.finder" to set the clipboard to strNames

Last edited by RobTrew; 2010-11-15 at 12:14 PM..