Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Draft

Draft (Drafts)

The ThoughtAsylum library includes a set of extensions to the Draft object

Hierarchy

  • Draft

Index

Methods

TA_archiveInboxDraftsTagged

  • TA_archiveInboxDraftsTagged(p_astrTags: string[]): number
  • Archive all inbox drafts with a specific set of tags. Returns the number of drafts that were archived.

    Parameters

    • p_astrTags: string[]

      An array of tag names to be matched against.

      // Example
      draft.TA_archiveInboxDraftsTagged(["foo", "bar"]);

    Returns number

TA_convertAllToTasks

  • TA_convertAllToTasks(): void
  • Converts all non-blank non-task lines to tasks. Uses the taskBasicStart, taskBasicComplete and taskBasicIncomplete Library settings.

    // Example
    draft.TA_convertAllToTasks();

    Returns void

TA_deduplicateLines

  • TA_deduplicateLines(): void
  • TA_deduplicateLines(): void
  • Deduplicates lines in the draft, retaining the original order of first occurrence.

    // Example
    draft.TA_deduplicateLines();

    Returns void

  • Adds a set of tags defined as an array of strings from the draft.

    Returns void

TA_dictateList

  • TA_dictateList(p_strGrammar?: string, p_strMarker?: string): Boolean
  • Prompts a user to dictate a list. Each entry dicatated on a new line will be created as a separate list item. Note that you can create a new line in English dictations simply by saying "new line". By default the function will use the library defaults for a task marker - comprising a concatenation of the library properties taskBasicStart, taskBasicIncomplete, and taskBasicEnd. When dictation is received, the function will return the created draft object. When dictation is not received (e.g. if the user cancels), the draft object being used for the function will be returned.

    Parameters

    • Optional p_strGrammar: string

      The name of the syntax for the dictated draft. Defaults to the tadBasicSyntax property of the library object (i.e. settings).

    • Optional p_strMarker: string

      The string used at the start of a dictated line to mark the line as a list item. Defaults to a concatenation of tadBasicSyntax properties of the library object (i.e. settings).

      // Example
      draft.TA_dictateList("Markdown", "- ");

    Returns Boolean

TA_dictateListAndLoad

  • TA_dictateListAndLoad(): Draft
  • Prompts a user to dictate a list. Each entry dicatated on a new line will be created as a separate list item. Note that you can create a new line in English dictations simply by saying "new line". By default the function will use the library defaults for a task marker - comprising a concatenation of the library properties taskBasicStart, taskIncomplete, and taskBasicEnd. When dictation is received, the function will load the new draft into the editor and return the created draft object. When dictation is not received (e.g. if the user cancels), the draft object being used for the function will loaded into the editor and it will be returned.

    Returns Draft

TA_dictateListMarkdown

  • TA_dictateListMarkdown(): Draft
  • Prompts a user to dictate a new Simple List list. Each entry dicatated on a new line will be created as a separate list item. Note that you can create a new line in English dictations simply by saying "new line". -[ ] will be used for denoting list items. When dictation is received, the function will load the new draft into the editor and return the created draft object. When dictation is not received (e.g. if the user cancels), the draft object being used for the function will loaded into the editor and it will be returned.

    // Example
    draft.TA_dictateListMarkdown();

    Returns Draft

TA_dictateListSimple

  • TA_dictateListSimple(): Draft
  • Prompts a user to dictate a new Simple List list. Each entry dicatated on a new line will be created as a separate list item. Note that you can create a new line in English dictations simply by saying "new line". [ ] will be used for denoting list items. When dictation is received, the function will load the new draft into the editor and return the created draft object. When dictation is not received (e.g. if the user cancels), the draft object being used for the function will loaded into the editor and it will be returned.

    // Example
    draft.TA_dictateListSimple();

    Returns Draft

TA_dictateListTaskpaper

  • TA_dictateListTaskpaper(): Draft
  • Prompts a user to dictate a new Taskpaper list. Each entry dicatated on a new line will be created as a separate list item. Note that you can create a new line in English dictations simply by saying "new line". - will be used for denoting list items. When dictation is received, the function will load the new draft into the editor and return the created draft object. When dictation is not received (e.g. if the user cancels), the draft object being used for the function will loaded into the editor and it will be returned.

    // Example
    draft.TA_dictateListTaskpaper();

    Returns Draft

TA_draftCountSummary

  • TA_draftCountSummary(): void
  • Display a count of Drafts with various breakdowns in a preview window. The counts of flagged, not flagged and total are displayed for the inbox, archive and trash folders, as well as the subtotals thereof. The counts of individual tags are displayed for flagged, not flagged, inbox, archive, total (flagged + unflagged), and trash. The counts of individual workspaces are displayed for flagged, not flagged, inbox, archive, total (flagged + unflagged), and trash. The resulting summary is displayed as rendered HTML in a preview window.

    // Example
    draft.TA_draftCountSummary();

    Returns void

TA_draftCountSummaryFlagged

  • TA_draftCountSummaryFlagged(p_strFolder: string): number
  • Counts and returns the number of flagged drafts in a folder.

    Parameters

    • p_strFolder: string

      the folder (see draftFolderTab) for which to count.

      // Example
      alert(draft.TA_draftCountSummaryFlagged("inbox"));

    Returns number

TA_draftCountSummaryFolder

  • TA_draftCountSummaryFolder(p_strFolder: string): number
  • Counts and returns the number of drafts (flagged & unflagged) in a folder.

    Parameters

    • p_strFolder: string

      the folder (see draftFolderTab) for which to count.

      // Example
      alert(draft.TA_draftCountSummaryFolder("archive"));

    Returns number

TA_draftCountSummaryTag

  • TA_draftCountSummaryTag(p_strTag: string): string
  • Counts and returns the number of draft occurrences with a particular tag that matches a folder or attribute. The return is an HTML formatted string exclusively for use with the draft.TA_draftCountSummary function. Calculations include flagged, not flagged, inbox, archive, total and trash.

    Parameters

    • p_strTag: string

      the name of the tag to generate the counts for.

      // Example
      alert(draft.TA_draftCountSummaryTag("foo"));

    Returns string

TA_draftCountSummaryWorkspace

  • TA_draftCountSummaryWorkspace(p_wsInfo: Workspace): string
  • Counts and returns the number of draft occurrences within a particular workspace that matches a folder or attribute. The return is an HTML formatted string exclusively for use with the draft.TA_draftCountSummary function. Calculations include flagged, not flagged, inbox, archive, total and trash.

    Parameters

    • p_wsInfo: Workspace

      the nworkspace object to generate the counts for.

      // Example
      alert(draft.TA_draftCountSummaryWorkspace(Workspace.query("all")[0])));

    Returns string

TA_draftNew

  • TA_draftNew(p_strContent: string): Draft
  • Create and load a new draft based on the text passed in. The editor will also be set to activate.

    Parameters

    • p_strContent: string

      the text to set as the draft content.

      // Example
      draft.TA_draftNew("Lorem Ipsum Dolor Sit Amet");

    Returns Draft

TA_draftNewFromClipboard

  • TA_draftNewFromClipboard(): Draft
  • Create a new draft based on the current clipboard content.

    // Example
    draft.TA_draftNewFromClipboard();

    Returns Draft

TA_draftNewFromClipboardAndLoad

  • TA_draftNewFromClipboardAndLoad(): Draft
  • Create and load a new draft based on the current clipboard content. The editor will also be set to activate.

    // Example
    draft.TA_draftNewFromClipboardAndLoad();

    Returns Draft

TA_draftNewFromClipboardURL

  • TA_draftNewFromClipboardURL(): Draft
  • Create a new draft based on the URL on the clipboard. The content for the new draft is fetched from the URL.

    // Example
    draft.TA_draftNewFromClipboardURL();

    Returns Draft

TA_draftNewFromClipboardURLAndLoad

  • TA_draftNewFromClipboardURLAndLoad(): Draft
  • Create and load a new draft based on the URL on the clipboard. The content for the new draft is fetched from the URL.

    // Example
    draft.TA_draftNewFromClipboardURLAndLoad();

    Returns Draft

TA_draftNewFromSelection

  • TA_draftNewFromSelection(): Draft
  • Create a new draft based on the current text selection in the editor. If no text is selected, a null (Draft) object will be returned instead of a (normal) Draft object.

    // Example
    draft.TA_draftNewFromSelection();

    Returns Draft

TA_draftNewFromSelectionAndLoad

  • TA_draftNewFromSelectionAndLoad(): Draft
  • Create and load a new draft based on the current text selection in the editor. The editor will also be set to activate. If no text is selected, a null (Draft) object will be returned instead of a (normal) Draft object.

    // Example
    draft.TA_draftNewFromSelectionAndLoad();

    Returns Draft

TA_draftNewFromTemplateDraft

  • TA_draftNewFromTemplateDraft(): Draft
  • Create a new draft based on a template stored in a template draft. Template drafts are stored in drafts in a folder and with tags as defined by the TADLibrary.templateFilter and TADLibrary.templateTags settings respectively. A list of templates is displayed for the user, from which they can choose the template to use. A new draft is then created with the content.

    // Example
    draft.TA_draftNewFromTemplateDraft();

    Returns Draft

TA_draftNewFromTemplateFile

  • TA_draftNewFromTemplateFile(): Draft
  • Create a new draft based on a template stored in a template draft. Template drafts are stored in the Drafts /Library/Templates/ folder. A list of templates is displayed for the user, from which they can choose the template to use. A new draft is then created with the content, tags and syntax baing based ont he source template draft. Note that the tags that define the draft as a template are epxlicitly excluded when generating the new draft.

    // Example
    draft.TA_draftNewFromTemplateFile();

    Returns Draft

TA_draftNew_ContentSyntax

  • TA_draftNew_ContentSyntax(p_strSyntax: string): void
  • Creates a new draft with a specific set of content and a specific syntax. The content is downloaded from a public git repository, so only supported syntaxes are available. See HTTP.TA_getSyntaxTest() for additional details.

    Parameters

    • p_strSyntax: string

      The syntax type the new draft should be set to.

      // Example
      draft.TA_draftNew_ContentSyntax(, "Markdown");

    Returns void

TA_draftNew_Discourse

  • TA_draftNew_Discourse(): void
  • Sets an empty draft as a Discourse draft, otherwise prompts to convert the existing one or create a new one. Sets the syntax and tags of the draft based on values held in the library settings.

    // Example
    draft.TA_draftNew_Discourse();

    Returns void

TA_draftSetUp

  • TA_draftSetUp(p_astrTags: string[], p_strSyntax: string, p_bRemoveTags?: Boolean): void
  • Sets a draft up with a set of prescribed tags and syntax based on some properties from the library settings. Sets the syntax and tags based on parameters passed to it. Note, existing tags are not removed.

    Parameters

    • p_astrTags: string[]

      an array of the tag names to add to the draft.

    • p_strSyntax: string

      the name of the syntax grammar type to set the draft to.

    • Optional p_bRemoveTags: Boolean

      will remove all existing tags if set to true, set to false by default.

      // Example
      draft.TA_draftSetUp(tadLib.draft_discourse.tags, tadLib.draft_discourse.syntax, false);

    Returns void

TA_draftSetUp_Discourse

  • TA_draftSetUp_Discourse(): void
  • Sets a draft for use in a Discourse forum, such as Drafts' own forum. Sets the syntax and tags of the draft based on values held in the library settings.

    // Example
    draft.TA_draftSetUp_Discourse();

    Returns void

TA_duplicate

  • Duplicates a draft including setting the content, the syntax, and the tags. The currently loaded draft remains loaded in the editor. i.e. a live backup copy is created.

    // Example
    draft.TA_duplicate();

    Returns Draft

TA_duplicateAndLoad

  • TA_duplicateAndLoad(): Draft
  • Duplicates a draft including setting the content, the syntax, and the tags, and then loads the new draft into the editor.

    // Example
    draft.TA_duplicateAndLoad();

    Returns Draft

TA_explodedMDPreview

  • TA_explodedMDPreview(p_bConvertCheckboxes?: Boolean): void
  • Preview of Markdown content that includes numerous reference expansions. The function will expand standard template utility tag inclusions (as well as other tag inclusions), a single level of wiki-style tags linked to other drafts, and local images where a Base 64 version of the image has been co-located and stored in a .b64.txt file (convention). Drafts-style checkboxes ("[ ] / [X]") can also optionally be converted to HTML-based checkboxes via the setting of a parameter. The resulting converted string is then set as the value of a custom tag for the draft, preview. This HTML populated tag is then easily referenced in subsequent action steps such as a Preview.

    Parameters

    • Optional p_bConvertCheckboxes: Boolean

      option to convert Drafts style checkboxes to HTML-base checkboxes. Defaults to false.

      // Example
      draft.TA_explodedMDPreview(true);

    Returns void

TA_getMDHeadings

  • TA_getMDHeadings(): string[]
  • Return an array of Markdown Headings in a draft. The hash tags are included.

    // Example
    alert(draft.TA_getMDHeadings()[2]);
    //Shows the third heading.

    Returns string[]

TA_getRecentDraftData

  • TA_getRecentDraftData(p_intSelectLimit?: number, p_strTemplateTag?: string): void
  • Display a list of recent drafts and retrieve a specific piece of data from it. If no specific data is passed in (i.e. second parameter is ""), the user will be prompted to select data to retrieve. The retrieval is based around Drafts template tags.

    Parameters

    • Optional p_intSelectLimit: number

      the number of recent drafts to retrieve. Defaults to 10.

    • Optional p_strTemplateTag: string

      an optional template tag string containing a Draft template tag to retrieve.

      // Example
      alert(draft.TA_getRecentDraftData(12, "safe_title"));

    Returns void

TA_infoDump

  • TA_infoDump(p_strJSONDraftDataTagPrefix?: string, p_boolReturnJSON?: Boolean): JSON | string
  • Dumps a set of draft related data into JSON and a Drafts template tag. The data dump is stored in a template tag generated from the first parameter followed by an underscore and then the UUID of the draft. This function can therefore be called several times, and the draft data for several other drafts can be held against a unique ID custom tag, derivable from the original draft's UUID. The second parameter determines the function's return type.

    Parameters

    • Optional p_strJSONDraftDataTagPrefix: string

      the prefix string to use with the dataid, the default is DATAID.

    • Optional p_boolReturnJSON: Boolean

      when set to true, the function returns a JSON object, when false a stringified version. The default is false.

      // Example
      alert(draft.TA_infoDump("xxx", false));

      The available properties included in the information "dump" are:

      • dataid - a unique identifier for this JSON/object.
      • uuid - the unique identifier for the draft.
      • content - the content of the draft.
      • title - the first line of the draft.
      • languageGrammar - the syntax specified for the draft.
      • selectionStart - the integer index of the start location of the last text selection in the draft.
      • selectionLength - the number of characters in the last text selection in the draft.
      • tags - an array of the names of the tags associated with the draft.
      • isArchived - true if the tag has been archived, false otherwise.
      • isTrashed - true if the tag has been trashed, false otherwise.
      • isFlagged - true if the tag has been flagged, false otherwise.
      • createdAt - the timestamp for when the draft was created.
      • createdLatitude - the latitude at which the draft was created.
      • createdLongitude - the longitude at which the draft was created
      • modifiedAt - the timestamp for when the draft was last modified.
      • modifiedLatitude - the latitude at which the draft was last modified.
      • modifiedLongitude - the longitude at which the draft was last modified
      • numberofversions - the number of versions of the draft that Drafts has stored.
      • permalink - a URL to open the draft.
      • selection - the text selection, or the full draft content if no text was selected.
      • safe_title - the first line of the draft with ASCII control characters and path separators removed.
      • selection_only - the text selection, or an empty string if no text was selected.
      • body - all of the draft except for the first line.
      • last_line - the last line of the draft.

    Returns JSON | string

TA_lineCount

  • Counts lines the number of lines in the draft.

    // Example
    alert(draft.TA_lineCount(0));

    Parameters

    • Optional p_intBase: TYPE_intCountBase

      Pass in a base of 0 or 1 for how many lines an empty string counts as, defaults to 0.

    Returns number

TA_lineForEach

  • TA_lineForEach(someFunction: string): string[]
  • Run a function against each line in a draft.

    Parameters

    • someFunction: string

      The name of the function to run against the line.

      // Example
      draft.TA_lineForEach(sendToReminders);

    Returns string[]

TA_newExample_GitHubMarkdown

  • TA_newExample_GitHubMarkdown(): void
  • Creates a new example GitHub Markdown draft.

    // Example
    draft.TA_newExample_GitHubMarkdown();

    Returns void

TA_newExample_JavaScript

  • TA_newExample_JavaScript(): void
  • Creates a new example JavaScript draft.

    // Example
    draft.TA_newExample_JavaScript();

    Returns void

TA_newExample_Markdown

  • TA_newExample_Markdown(): void
  • Creates a new example Markdown draft.

    // Example
    draft.TA_newExample_Markdown();

    Returns void

TA_newExample_MultiMarkdown

  • TA_newExample_MultiMarkdown(): void
  • Creates a new example MultiMarkdown draft.

    // Example
    draft.TA_newExample_MultiMarkdown();

    Returns void

TA_newExample_PlainText

  • TA_newExample_PlainText(): void
  • Creates a new example Plain Text draft.

    // Example
    draft.TA_newExample_PlainText();

    Returns void

TA_newExample_SimpleList

  • TA_newExample_SimpleList(): void
  • Creates a new example Simple List draft.

    // Example
    draft.TA_newExample_SimpleList();

    Returns void

TA_newExample_Taskpaper

  • TA_newExample_Taskpaper(): void
  • Creates a new example Taskpaper draft.

    // Example
    draft.TA_newExample_Taskpaper();

    Returns void

TA_removeBlankLines

  • TA_removeBlankLines(): void
  • Removes lines from the draft containing no content or whitespace only.

    // Example
    draft.TA_removeBlankLines();

    Returns void

TA_removeEmptyLines

  • TA_removeEmptyLines(): void
  • Removes lines from the draft containing no content.

    // Example
    draft.TA_removeEmptyLines();

    Returns void

TA_removeSpaceTabLeading

  • TA_removeSpaceTabLeading(): void
  • Removes leading spaces and tabs from the lines of a draft. Lines containing only spaces and tabs remain as empty lines. Initially empty lines remain unaffected.

    // Example
    draft.TA_removeSpaceTabLeading();

    Returns void

TA_removeWhitespaceLeading

  • TA_removeWhitespaceLeading(): void
  • Removes leading whitespace from the lines of a draft. Empty and lines only containing whitespace are removed.

    // Example
    draft.TA_removeWhitespaceLeading();

    Returns void

TA_removeWhitespaceLeadingTrailing

  • TA_removeWhitespaceLeadingTrailing(): void
  • Removes leading and trailing whitespace from the lines of a draft. Empty and lines only containing whitespace are removed.

    // Example
    draft.TA_removeWhitespaceLeadingTrailing();

    Returns void

TA_removeWhitespaceTrailing

  • TA_removeWhitespaceTrailing(): void
  • Removes trailing whitespace from the lines of a draft. Empty and lines only containing whitespace are removed.

    // Example
    draft.TA_removeWhitespaceTrailing();

    Returns void

TA_selectAnyTagDelete

  • TA_selectAnyTagDelete(p_bInfo?: Boolean): void
  • Prompts the user for a tag to delete and deletes it. Displays an information message if no tags are available.

    Parameters

    • Optional p_bInfo: Boolean

      Whether to display a summary information message. true will, false won't (default).

      // Example
      draft.TA_selectAnyTagDelete(true);

    Returns void

TA_selectAnyTagRename

  • TA_selectAnyTagRename(p_bInfo?: Boolean): void
  • Prompts the user for a tag to rename and what to rename it to. Displays an information message if no tags are available.

    Parameters

    • Optional p_bInfo: Boolean

      Whether to display a summary information message. true will, false won't (default).

      // Example
      draft.TA_selectAnyTagRename(true);

    Returns void

TA_selectRecentTagDelete

  • TA_selectRecentTagDelete(p_bInfo?: Boolean): void
  • Prompts the user for a tag to delete from a list of recent tags, and then deletes it. Displays an information message if no tags are available.

    Parameters

    • Optional p_bInfo: Boolean

      Whether to display a summary information message. true will, false won't (default).

      // Example
      draft.TA_selectRecentTagDelete(true);

    Returns void

TA_selectRecentTagRename

  • TA_selectRecentTagRename(p_bInfo?: Boolean): void
  • Prompts the user for a tag to rename from a list of recent tags, and what to rename it to. Displays an information message if no tags are available.

    Parameters

    • Optional p_bInfo: Boolean

      Whether to display a summary information message. true will, false won't (default).

      // Example
      draft.TA_selectRecentTagRename(true);

    Returns void

TA_selectSetTags

  • TA_selectSetTags(): Boolean
  • Set a draft's tags based on all previously used tags and what it currently has set. This allows the user to turn existing tags on and off against the draft. Returns true if changes are applied, and false if the user cancels.

    // Example
    draft.TA_selectSetTags();

    Returns Boolean

TA_setSyntax

  • TA_setSyntax(p_astrSyntaxes: string[]): boolean
  • Displays a pop up window to allow the user to specify a syntax. The syntax names passed in should be exact matches to valid Drafts syntax types, and will be displayed as a list of buttons in the order they are provided to the function. Returns true if the user changes the syntax.

    Parameters

    • p_astrSyntaxes: string[]

      An array of syntax names to choose from.

      // Example
      draft.TA_setSyntax(["Taskpaper", "Simple List"]);

    Returns boolean

TA_setSyntaxAllStandard

  • TA_setSyntaxAllStandard(): boolean
  • Displays a pop up window to allow the user to specify a syntax from the standard Drafts syntaxes. Standard syntaxes are defined iun the constant TA_DRAFTS_SYNTAX. Returns true if the user changes the syntax.

    // Example
    draft.TA_setSyntaxAllStandard();

    Returns boolean

TA_shareFile

  • TA_shareFile(p_strFileExtension?: string, p_bAsHTML?: Boolean): void
  • Quick share the content of a draft as a file. Uses the draft's safe title as the default for the filename, but if that happens to be null, will use the current timestamp instead. The user is prompted to change the filename, and after confirming, the content is passed to the share sheet. Note that if the second parameter is set to true, the content will process the content to HTML. This is useful for sharing a Markdown file as an HTML equivalent for example.

    Parameters

    • Optional p_strFileExtension: string

      specifies the file extension, defaults to txt.

    • Optional p_bAsHTML: Boolean

      when true will run the content through the Drafts HTML processor, defaults to false.

      // Example
      draft.TA_shareFile("md", false);

    Returns void

TA_shareFileBasedOnSyntax

  • TA_shareFileBasedOnSyntax(): void
  • Quick share the content of a draft as a file based on the syntax of the draft. Uses the draft's safe title as the default for the filename, but if that happens to be null, will use the current timestamp instead. The file extension is derived from the syntax and information specified in the tadLibrary settings for different types of drafts. The user is prompted to change the filename, and after confirming, the content is passed to the share sheet.

    // Example
    draft.TA_shareFileBasedOnSyntax();

    Returns void

TA_split

  • TA_split(p_bLoadSecondDraft?: Boolean): void
  • Splits a draft based on the position of the selection in the currently loaded draft. This is generally intended to be run against the currently active draft in the editor, but if you have an exact duplicate, it could be reasonably run against that instead, based on your current selection. After split, the editor is reactivated.

    Parameters

    • Optional p_bLoadSecondDraft: Boolean

      when true, will load the second draft of the split. When false, the default, it will retain the currently loaded draft (typically the first of the split).

      // Example
      draft.TA_split(true);

    Returns void

TA_tagAddCSV

  • TA_tagAddCSV(p_strTags: string): void
  • Adds a set of tags defined as a string of tag names to the draft.

    Parameters

    • p_strTags: string

      a string of comma separated tags to be added, with each tag being specified by name.

      // Example
      draft.TA_tagAddCSV("foo,bar,baz");

    Returns void

TA_tagDelete

  • TA_tagDelete(p_strTag: string, p_bInfo?: Boolean): void
  • Removes a tag on all drafts. Effectively deletes a tag.

    Parameters

    • p_strTag: string

      The tag to be deleted.

    • Optional p_bInfo: Boolean

      Whether to display a summary information message. true will, false won't (default).

      // Example
      draft.TA_tagDelete("foo", "bar", true);

    Returns void

TA_tagFetchAll

  • TA_tagFetchAll(): string[]
  • Return an array of all tag names held against drafts. The array is sorted in alphabetical order.

    // Example
    alert(draft.TA_tagFetchAll().join("\n"));

    Returns string[]

TA_tagRemove

  • TA_tagRemove(p_astrTags: string[]): void
  • Removes a set of tags defined as an array of strings from the draft. Tags marked for removal that are not associated with the tag are effectively ignored.

    Parameters

    • p_astrTags: string[]

      an array of tags to be removed, with each tag being specified by name.

      // Example
      draft.TA_tagRemove(["foo", "bar"]);

    Returns void

TA_tagRemoveAll

  • TA_tagRemoveAll(): void
  • Removes all tags from the draft.

    // Example
    draft.TA_tagRemoveAll();

    Returns void

TA_tagRename

  • TA_tagRename(p_strFrom: string, p_strTo: string, p_bInfo?: Boolean): void
  • Replaces a tag on all drafts with another tag. Effectively a rename of a tag on all drafts.

    Parameters

    • p_strFrom: string

      The original tag to be renamed.

    • p_strTo: string

      What to rename the original tag to.

    • Optional p_bInfo: Boolean

      Whether to display a summary information message. true will, false won't (default).

      // Example
      draft.TA_tagRename("foo", "bar", true);

    Returns void

TA_tagRenameInstance

  • TA_tagRenameInstance(p_strFrom: string, p_strTo: string): void
  • Replaces one tag on a draft with another tag. Effectively a rename of a tag on a single draft.

    Parameters

    • p_strFrom: string

      The original tag to be renamed.

    • p_strTo: string

      What to rename the original tag to.

      // Example
      draft.TA_tagRenameInstance("foo", "bar");

    Returns void

TA_trashEmptyDrafts

  • TA_trashEmptyDrafts(): number
  • Send all empty drafts to the trash. Returns the number of drafts that have been trashed.

    // Example
    draft.TA_trashEmptyDrafts();

    Returns number

TA_trashInboxDraftsTagged

  • TA_trashInboxDraftsTagged(p_astrTags: string[]): number
  • Trash all inbox drafts with a specific set of tags. Returns the number of drafts that were moved to the trash.

    Parameters

    • p_astrTags: string[]

      An array of tag names to be matched against.

      // Example
      draft.TA_trashInboxDraftsTagged(["foo", "bar"]);

    Returns number

TA_wordCount

  • TA_wordCount(): number
  • Counts the number of words in the draft.

    // Example
    alert(draft.TA_wordCount());

    Returns number