Should flagged drafts be included in archive.
Should flagged drafts be included in inbox.
OptionalloadAction group to load in Action Bar when applying the workspace.
OptionalloadAction group to load in action list when applying the workspace.
OptionalloadFolder tab to select when applying the workspace.
OptionalpreferredPreferred dark theme to load when applying the workspace.
OptionalpreferredPreferred light theme to load when applying the workspace.
Show date information in list.
Show last logged action for draft in list.
Show preview of draft body in list.
When a queryString value is set for the workspace, replace the preview text content with a summary of matches in the text.
Show draft tags in list.
A QueryDate specifying a date which all drafts in the workspace must be less than or equal to.
Filter by flagged status of drafts.
Search string to filter results.
A QueryDate specifying a date which all drafts in the workspace must be greater than or equal to.
Comma-delimited list tag string like "blue, !green" using "!" to omit a tag.
If true, all (AND) tags in the tag filter must match, if false match any of the tags (OR)
ReadonlyinstallURL which can be used to install this Workspace in another installation of Drafts. Useful for sharing and backups.
The name of the workspace.
Create new instance.
Query for a list of drafts contained in the workspace.
Save changes made to the workspace to the database. This must be called to save changes.
Staticcreatecreate a new workspace object. This is an in-memory object only, unless update() is called to save the it. The initial state of the workspace properties is based on the configuration of the user's default workspace.
StaticfindSearch for workspace matching the name passed and return it if found. Returns undefined if not found.
StaticgetGet list of all available workspaces.
Set sort order for "all" drafts folder.
Set sort order for archive.
Set sort order for inbox.
Represents a Workspace. Can be used to inquire and load workspaces and apply them using methods on the App object.
Note that is can also be useful in script to create and load temporary workspaces to apply filters or query drafts. If you create a new
Workspaceobject and never callupdate()that workspace will not be saved after the end of an action's execution.Example
Find and Load Workspace