#
cp.app.prefs
Provides access to application preferences, typically stored via NSUserDefaults
or CFProperties
.
To access the preferences, simply pass in the Bundle ID (eg. "com.apple.Preview") and it will return
a table whose keys can be accessed or updated, or iterated via ipairs
.
For example:
local previewPrefs = require "cp.app.prefs" "com.apple.Preview"
previewPrefs.MyCustomPreference = "Hello world"
print(previewPrefs.MyCustomPreference) --> "Hello world"
for k,v in pairs(previewPrefs) do
print(k .. " = " .. tostring(v))
end
#
API Overview
Functions - API calls offered directly by the extension
bundleID get is prop set
Constructors - API calls which return an object, typically one that offers API methods
prefs