Database Settings

Settings represent the database synchronized configuration values.

NOTE: editing these should be done with care, as storing invalid values may corrupt your database or produce instability in the various client applications.

Settings Keys

Each of the database settings is represented by a key string. Here’s a script for accessing a list of the database keys:

settings.keys.sort().sort().join("\n")
omnifocus://localhost/omnijs-run?script=try%7Bconsole%2Elog%28settings%2Ekeys%2Esort%28%29%2Esort%28%29%2Ejoin%28%22%5Cn%22%29%29%7Dcatch%28err%29%7Bconsole%2Elog%28err%29%7D

Here are the resulting keys:

Settings Functions

The value of the database settings are accessed and altered by using the following functions, passing in the target key string as a function parameter.

Here are the settings functions:

Examples

Here are some example scripts for accessing and changing settings values:

settings.objectForKey('InboxIsActive') //--> true settings.defaultObjectForKey('InboxIsActive') //--> true settings.boolForKey('InboxIsActive') //--> true settings.setBoolForKey(false, 'InboxIsActive') settings.boolForKey('InboxIsActive') //--> false
console.log("objectForKey: ", settings.objectForKey('InboxIsActive')) console.log("defaultObjectForKey: ", settings.defaultObjectForKey('InboxIsActive')) console.log("boolForKey: ", settings.boolForKey('InboxIsActive')) settings.setBoolForKey(false,'InboxIsActive') console.log("setBoolForKey: false") console.log("boolForKey: ", settings.boolForKey('InboxIsActive'))
omnifocus://localhost/omnijs-run?script=try%7Bconsole%2Elog%28%22objectForKey%3A%20%22%2C%20settings%2EobjectForKey%28%27InboxIsActive%27%29%29%0Aconsole%2Elog%28%22defaultObjectForKey%3A%20%22%2C%20settings%2EdefaultObjectForKey%28%27InboxIsActive%27%29%29%0Aconsole%2Elog%28%22boolForKey%3A%20%22%2C%20settings%2EboolForKey%28%27InboxIsActive%27%29%29%0Asettings%2EsetBoolForKey%28false%2C%27InboxIsActive%27%29%0Aconsole%2Elog%28%22setBoolForKey%3A%20false%22%29%0Aconsole%2Elog%28%22boolForKey%3A%20%22%2C%20settings%2EboolForKey%28%27InboxIsActive%27%29%29%7Dcatch%28err%29%7Bconsole%2Elog%28err%29%7D
targetKey = 'InboxIsActive' defaultValue = settings.defaultObjectForKey(targetKey) settings.setBoolForKey(defaultValue, targetKey)
omnifocus://localhost/omnijs-run?script=try%7BtargetKey%20%3D%20%27InboxIsActive%27%0AdefaultValue%20%3D%20settings%2EdefaultObjectForKey%28targetKey%29%0Asettings%2EsetBoolForKey%28defaultValue%2C%20targetKey%29%7Dcatch%28err%29%7Bconsole%2Elog%28err%29%7D

Here's a script demonstrating how to get and set the value of the start time setting:

settings.defaultObjectForKey('DefaultStartTime') //--> "00:00" settings.objectForKey('DefaultStartTime') //--> "00:00" settings.setObjectForKey('01:00','DefaultStartTime') //--> "01:00" defaultValue = settings.defaultObjectForKey('DefaultStartTime') settings.setObjectForKey(defaultValue,'DefaultStartTime')

Here's a script demonstrating how to get and set the granularity value of the due soon setting:

settings.defaultObjectForKey('DueSoonGranularity') //--> 1 settings.integerForKey('DueSoonGranularity') //--> 1 settings.setIntegerForKey(0,'DueSoonGranularity') //--> 0 defaultValue = settings.defaultObjectForKey('DueSoonGranularity') settings.setIntegerForKey(defaultValue,'DueSoonGranularity')
UNDER CONSTRUCTION

This webpage is in the process of being developed. Any content may change and may not be accurate or complete at this time.

DISCLAIMER