Hey fellow automators, I’ve been doing more and more with Scriptable. In doing so, I found the need to use a Key-Value Database several times. Today I decided I’d create a general-use version that anyone can use.
In order to use KeyValueDB, download the script and put it in your Scriptable folder.
- Local storage only currently
- Uses JSON internally to store data
Import the file
var KeyValueDB = importModule('KeyValueDB'); var db = new KeyValueDB('YourProjectName');
Get a value by key
var val = db.getValue(key)
Set a value by key
Append a value to an array with the specified key
var object = db.getAll()