Drafts Script Reference
    Preparing search index...

    Class Window

    Access Window properties and functions through the currentWindow property of the global app object.

    Index

    Interface

    areFiltersVisible: boolean

    Is the tag filters side panel is visible.

    canCreateTab: boolean

    Returns true if tabbed windows are available (Mac only)

    floatOnTop: boolean

    Toggle whether "Float on Top" is enabled for the window, keeping it above other apps. This property only has effect on macOS, and is ignored on iOS.

    isActionListVisible: boolean

    Is the action list side panel is visible.

    isDraftListVisible: boolean

    Is the draft list side panel is visible.

    • Close action list side bar.

      Returns void

    • Close draft list side bar.

      Returns void

    • Close tag filters side bar.

      Returns void

    • Load the ActionGroup in the action bar below editor.

      Parameters

      Returns boolean

    • Load the ActionGroup in the action list side bar.

      Parameters

      Returns boolean

    • If able, open the requested draft in a new tab in the current window. This method only functions on Mac. The ability to open new tabs is not available on iPhone or iPad.

      Parameters

      Returns boolean

      true if successful. false if unable to open a new tab.

    • Open action list side bar.

      Returns void

    • Open command palette window, optionally providing a initial query value.

      Parameters

      • OptionalinitialQuery: string

      Returns void

    • Open the "Get Info" view for a draft. If no draft is passed, the current active draft in the editor will be used.

      Parameters

      Returns void

    • Open draft list side bar.

      Returns void

    • Open tag filters side bar.

      Returns void

    • Open quick search window, optionally providing a initial query value.

      Parameters

      • OptionalinitialQuery: string

      Returns void

    Other

    selectedDrafts: Draft[]

    Array of the drafts currently selected by the user in the draft list. Can be iterated to create custom actions which operate on the selection.

    Workspace

    currentWorkspace: Workspace

    Returns a workspace object configured like the workspace currently loaded in the draft list of the window. Useful when creating logic which reacts contextually to the workspace loaded.

    • Apply the Workspace as if it was selected in draft list. Calling this function with no arguments will clear filters and apply the default workspace.

      Parameters

      Returns boolean