The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus Extras (http://forums.omnigroup.com/forumdisplay.php?f=44)
-   -   document.settings (http://forums.omnigroup.com/showthread.php?t=17853)

RobTrew 2010-09-09 02:04 AM

document.settings
 
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[/CODE]

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:
[INDENT]InboxIsActive
OFMProcessCompletedInboxItems
OFMTaskDefaultSequential
OFMDefaultSingletonProjectPersistentIdentifier
OFMAutomaticallyHideCompletedItems
OFMRequiredRelationshipToProcessInboxItem
PerspectiveOrder
ProjectInfoReviewRepetitionString
OFMNamedObjectHierarchicalNameSeparator
DefaultDueTime
OFMCompleteWhenLastItemComplete
ContextModeShowsParents
ReminderCalendarAlarmIndex
ReminderCalendarExportEnabled
DueSoonInterval[/INDENT]
[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[/CODE]


All times are GMT -8. The time now is 10:12 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.