Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TadBear

TadBear (Library)

This is a class that is used for interacting with the Bear app by Shiny Frog.

Hierarchy

  • TadBear

Index

Constructors

constructor

  • Creates new instance of TadBear class. The construction specifies default settings values.

    Returns TadBear

Properties

baseCallbackURL

baseCallbackURL: string

The base callback URL is the one used to call the Bear app The value defaults to bear://x-callback-url/

baseURL

baseURL: string

The base URL is the one used to call the Bear app The value defaults to bear://

debug

debug: Boolean

Defaults to false, but when set to true, will display the URL being called before calling it. Used for debugging purposes only, and is not reset by a call to TA_reset().

fonts

fonts: string[]

Initialised to an array of available font names in Bear.

parameters

parameters: object

The set of parameters used to build the URL to control Bear. Parameters are added to this attribute as additional attributes and then compiled into the final call URL. After a call, any parameters can be checked individually by referencing them and of course all parameters are available as a set - though there are additional functions and attributes to help with debuggin activities.

themes

themes: string[]

Initialised to an array of available theme names in Bear.

url

url: string

This is initialised on each reset, but on each call, it is populated with a simplified URL without the x-callback parameters. You can display this after a call to see the basis of what call was sent.

Methods

TA_addParamBool

  • TA_addParamBool(p_strParameter: string, p_bInput: Boolean): void
  • Add a Boolean to yes/no based URL parameter to the instance's parameters. The function takes the name of the parameter and the value and adds the name to the instance's parameters property as a new property, with the defined value translated to yes (true) or no (false). This parameter will then be picked up in the subsequent URL call to bear and included in the URL request string.

    Parameters

    • p_strParameter: string

      the name of the parameter.

    • p_bInput: Boolean

      the value of the parameter - while it is true/false, these get converted automatically to yes/no as used by the Bear URL scheme.

      // Example
      let tb = new TadBear();
      tb.TA_addParamBool("foo", true);

    Returns void

TA_addParamString

  • TA_addParamString(p_strParameter: string, p_strInput: string): void
  • Add a string based URL parameter to the instance's parameters. The function takes the name of the parameter and the value and adds the name to the instance's parameters property as a new property, with the defined value. This parameter will then be picked up in the subsequent URL call to bear and included in the URL request string, at which point it will be automatically URL encoded by the callback functionality - i.e. there is no need to URL encode it when passing the value to this function; if you do, it will be double encoded and lead to incompatibility issues.

    Parameters

    • p_strParameter: string

      the name of the parameter.

    • p_strInput: string

      the value of the parameter.

      // Example
      let tb = new TadBear();
      tb.TA_addParamString("foo", "bar");

    Returns void

TA_addParamToken

  • TA_addParamToken(): void
  • Add the device API token as a parameter to the instance's parameters. The token is always added as a parameter to the parameters property as a sub-property called token, and its value is taken from Draft' credentials store.

    // Example
    let tb = new TadBear();
    tb.TA_addParamToken();

    Returns void

TA_addText

  • TA_addText(p_strID?: string, p_strTitle?: string, p_bSelected?: Boolean, p_strText?: string, p_bClipboard?: Boolean, p_strHeader?: string, p_strMode?: TYPE_strBearModes, p_bNewLine?: Boolean, p_strTagsCSV?: string, p_bExcludeTrashed?: Boolean, p_bOpenNote?: Boolean, p_bNewWindow?: Boolean, p_bShowWindow?: Boolean, p_bEdit?: Boolean, p_bTimestamp?: Boolean): BearNoteContent
  • Append to, prepend to, or replace the text of a Bear note identified by its title, ID, or current editing of. The type of update of a note is determined by the mode and there are numerous options for controlling the behaviour, all managed through the wide-range of parameters. While all parameters are optional, you must specify one of the first three parameters to determine which Bear note is to be updated and you must specify one of the following three parameters to detemine what content will be updated.

    Parameters

    • Optional p_strID: string

      the unique identifier of the note to be updated. Defaults to an empty string.

    • Optional p_strTitle: string

      the title of the note to be updated. Defaults to an empty string.

    • Optional p_bSelected: Boolean

      defaults to false, but when set to true will cause the function to seek to update the note currently loaded into the Bear editor.

    • Optional p_strText: string

      the text to be used in the updating of the note. Defaults to an empty string.

    • Optional p_bClipboard: Boolean

      defaults to false, but uses the text on the clipboard to update the note, when set to true.

    • Optional p_strHeader: string

      the text to add to the header within the note. Defaults to an empty string.

    • Optional p_strMode: TYPE_strBearModes

      the mode used to update the note. Defaults to append.

    • Optional p_bNewLine: Boolean

      defaults to true, and when set to true and the mode is set to append, it will place a newline character between the existing content and the content being appended.

    • Optional p_strTagsCSV: string

      a comma separated list of tag names to apply to the note. Defaults to an empty string.

    • Optional p_bExcludeTrashed: Boolean

      defaults to true, and when set to true excludes the updating of any matched note that is trashed.

    • Optional p_bOpenNote: Boolean

      defaults to false, but when set to true it will display the updated note in Bear's main or external window.

    • Optional p_bNewWindow: Boolean

      defaults to false, but when set to true on the Mac, it will open the updated note in a new Bear window.

    • Optional p_bShowWindow: Boolean

      defaults to false, but on the Mac, when set to true, it will force Bear's main window to open.

    • Optional p_bEdit: Boolean

      defaults to false, but when set to true, it will place the cursor inside Bear's note editor.

    • Optional p_bTimestamp: Boolean

      defaults to false, but when set to true, it will prepend the current date and time to the text to the additional/replacement text.

      // Example
      let tb = new TadBear();
      let bncUpdated = tb.TA_addText("42E4B1E2-4772-4859-B613-ABBEC5F6F494-92147-00011C1079276C26", "", false, "lorem ipsum");
      alert(bncUpdated.title);
      alert(bncUpdated.note);

    Returns BearNoteContent

TA_archiveNote

  • TA_archiveNote(p_strID: string, p_bShowWindow?: Boolean): void
  • Move a Bear note (based on its ID) to the archive in Bear.

    Parameters

    • p_strID: string

      the unique identifier of the note to be archived.

    • Optional p_bShowWindow: Boolean

      defaults to false, but on the Mac, when set to true, it will force Bear's main window to open.

      // Example
      let tb = new TadBear();
      tb.TA_archiveNote("42E4B1E2-4772-4859-B613-ABBEC5F6F494-92147-00011C1079276C26");

    Returns void

TA_call

  • TA_call(p_strAction: string, p_bWaitForResponse?: Boolean): object
  • Run an x-callback-url call to Bear. This function executes an x-callback to Bear for the action passed into it, and the parameters specified against the Bear object instance. The funtion also sets the url property of the Bear instance to match the calling URL (without the x-* parameters). If the debug property of the Bear instance is set to true (not the default), the function will display the url property of the call in an alert before issuing it. The function returns the callback response on a successful call, but will return void if the call failed or was cancelled. The format of the response varies based on the type of call made.

    Parameters

    • p_strAction: string

      the name of the Bear URL action.

    • Optional p_bWaitForResponse: Boolean

      specifies whether to wait for a response or not. Defaults to yes.

      // Example
      let tb = new TadBear();
      tb.parameters.term = "foo";
      alert(JSON.stringify(tb.TA_call("search")));

    Returns object

TA_changeFont

  • Change the font in Bear.

    Parameters

    • p_strFont: TYPE_strBearFonts

      the name of the font.

    • Optional p_bShowWindow: Boolean

      defaults to false, but on the Mac, when set to true, it will force Bear's main window to open.

      // Example
      let tb = new TadBear();
      tb.TA_changeFont("Menlo");

    Returns void

TA_changeFontPrompt

  • Prompt user to change font in Bear app. The user is shown a prompt with a button for each available font. Selecting a font will trigger a URL call to set that as the font in the Bear app.

    Parameters

    • p_strFont: TYPE_strBearFonts
    • Optional p_bShowWindow: Boolean

      defaults to false, but on the Mac, when set to true, it will force Bear's main window to open.

      // Example
      let tb = new TadBear();
      tb.TA_changeFontPrompt();

    Returns void

TA_changeTheme

  • Change the font in Bear.

    Parameters

    • p_strTheme: TYPE_strBearThemes

      the name of the theme.

    • Optional p_bShowWindow: Boolean

      defaults to false, but on the Mac, when set to true, it will force Bear's main window to open.

      // Example
      let tb = new TadBear();
      tb.TA_changeTheme("Cobalt");

    Returns void

TA_changeThemePrompt

  • Prompt user to change theme in Bear app. The user is shown a prompt with a button for each available theme. Selecting a theme will trigger a URL call to set that as the theme in the Bear app.

    Parameters

    • p_strTheme: TYPE_strBearThemes
    • Optional p_bShowWindow: Boolean

      defaults to false, but on the Mac, when set to true, it will force Bear's main window to open.

      // Example
      let tb = new TadBear();
      tb.TA_changeThemePrompt();

    Returns void

TA_create

  • TA_create(p_strTitle?: string, p_strText?: string, p_bClipboard?: Boolean, p_strTagsCSV?: string, p_bOpenNote?: Boolean, p_bNewWindow?: Boolean, p_bFloat?: Boolean, p_bShowWindow?: Boolean, p_bPin?: Boolean, p_bEdit?: Boolean, p_bTimestamp?: Boolean): BearNoteIdentifiers
  • Create a new note in Bear. While the parameters are all option, you must populate at least one content parameter (the first three) to create a note.

    Parameters

    • Optional p_strTitle: string

      the title of the note to be created. Defaults to an empty string.

    • Optional p_strText: string

      the text to be used in the creation of the note. Defaults to an empty string.

    • Optional p_bClipboard: Boolean

      defaults to false, but uses the text on the clipboard to create the note, when set to true.

    • Optional p_strTagsCSV: string

      a comma separated list of tag names to apply to the note. Defaults to an empty string.

    • Optional p_bOpenNote: Boolean

      defaults to false, but when set to true it will display the created note in Bear's main or external window.

    • Optional p_bNewWindow: Boolean

      defaults to false, but when set to true on the Mac, it will open the created note in a new Bear window.

    • Optional p_bFloat: Boolean

      defaults to false, but when set to true on the Mac, it will make the external Bear window float above other windows.

    • Optional p_bShowWindow: Boolean

      defaults to false, but on the Mac, when set to true, it will force Bear's main window to open.

    • Optional p_bPin: Boolean

      defaults to false, but when set to true, it will mark the Bear note as pinned.

    • Optional p_bEdit: Boolean

      defaults to false, but when set to true, it will place the cursor inside Bear's note editor.

    • Optional p_bTimestamp: Boolean

      defaults to false, but when set to true, it will prepend the current date and time to the text to the additional/replacement text.

      // Example
      let tb = new TadBear();
      let objResult = tb.TA_create("Note Title", "Note content");
      alert(objResult.identifier);
      alert(objResult.title);

    Returns BearNoteIdentifiers

TA_deleteTag

  • TA_deleteTag(p_strName: string, p_bShowWindow?: Boolean): void
  • Delete an existing tag in Bear. The tag must not be associated with any locked notes. If it is, the tag may not be deleted.

    Parameters

    • p_strName: string

      the name of the tag to be deleted.

    • Optional p_bShowWindow: Boolean

      defaults to false, but on the Mac, when set to true, it will force Bear's main window to open.

      // Example
      let tb = new TadBear();
      tb.TA_deleteTag("foo");

    Returns void

TA_deviceTokenforBear

  • TA_deviceTokenforBear(): string
  • Retrieve/request API token for this device for interaction with Bear. The Bear token is unique to each device and any such tokens are stored in the Drafts credentials store. The ID for the token is generated by Drafts assigning a unique ID to every device and storing that ID in the device's local (file) storage for Drafts. When the ID is not present, it will be generated, and when the Bear API token is not set for that ID, it will be requested and the user should enter the API token. Details for where to find the token in different Bear client applications is available on the web site for Bear.

    // Example
    let tb = new TadBear();
    alert(tb.TA_deviceTokenforBear());

    Returns string

TA_deviceUUIDforBear

  • TA_deviceUUIDforBear(): string
  • Store a local device ID for use with storing Bear credentials. Bear has a unique API key for each device, so if you have multiple devices, you would require multiple IDs. Drafts does not have direct access to any unique identifiers of a device, so this function generates one. The function checks for a file in local Drafts storage called LocalBearID.txt. This file contains a single entry - a standard v4 unique identifier. If the file does not exist, then a new identifier is generated. This unique ID can then be used to distinguish between multiple Bear API tokens that get stored in Drafts' secure credentials area. This function returns the unique identifier for the device from the file, generating a new identifier if one is not present.

    // Example
    let tb = new TadBear();
    alert(tb.TA_deviceUUIDforBear());

    Returns string

TA_exportDraftToBear

  • TA_exportDraftToBear(p_draftExport: Draft): string
  • Export a draft into Bear. The content of the draft is made the content of a new Bear note. Any tags in Drafts for the draft are added as tags in Bear (leading # is added automatically by Bear). Returns the identifier for the new Bear note.

    Parameters

    • p_draftExport: Draft

      the draft to be exported.

      // Example
      let tb = new TadBear();
      alert(tb.TA_exportDraftToBear(draft));

    Returns string

TA_exportSelectionToBear

  • TA_exportSelectionToBear(): string
  • Export current selection into Bear. The currently selected content in Drafts, or the entire current draft content if there is no selection is made into a new Bear note. Returns the identifier for the new Bear note.

    Returns string

TA_getNoteContent

  • TA_getNoteContent(p_strID?: string, p_strTitle?: string): string
  • Get the content of a Bear note given its unique ID or a unique note title.

    Parameters

    • Optional p_strID: string

      the unique identifier of the note content to be retrieved. Defaults to an empty string.

    • Optional p_strTitle: string

      the title of the note content to be retrieved. Defaults to an empty string.

      // Example
      let tb = new TadBear();
      alert(tb.TA_getNoteContent("42E4B1E2-4772-4859-B613-ABBEC5F6F494-92147-00011C1079276C26"));

    Returns string

TA_grabURL

  • TA_grabURL(p_strURL: string, p_strTagsCSV?: string, p_bPin?: Boolean, p_bWait?: Boolean): BearNoteIdentifiers
  • Create a new Bear note with the content of a web page. This function triggers Bear to capture a simplified version of the web content specified by the URL and save it in a new note.

    Parameters

    • p_strURL: string

      the URL for Bear to retrieve the content for.

    • Optional p_strTagsCSV: string

      a comma separated list of tags to assign to the new note. Defaults to an empty string indicating no tags.

    • Optional p_bPin: Boolean

      defaults to false, but when set to true, it will mark the Bear note as pinned.

    • Optional p_bWait: Boolean

      defaults to true, and when set to that, it will return only when it can return the new note information. When set to false, it will return immediately without that information.

      // Example
      let tb = new TadBear();
      let bniResults = tb.TA_grabURL("https://tadpole.thoughtasylum.com");
      alert(`${bniResults.title} (${bniResults.identifier})`);

    Returns BearNoteIdentifiers

TA_importNoteToDrafts

  • TA_importNoteToDrafts(p_strID: string, p_astrImportTags?: string): string
  • Import a Bear note into Drafts. The content of the Bear note specified by the ID is made the content of a new draft. Any tags in Bear are added as tags in Drafts (no leading #), and the creation date is set to the creation date from Bear. The function also supports adding additional tags to an imported draft. This is useful for adding source tags and imported tags. If no matching note is found, the function returnsvoid, otherwise the UUID of the new draft is returned.

    Parameters

    • p_strID: string

      the unique identifier of the note to be imported.

    • Optional p_astrImportTags: string

      an array of tag names to add to the draft when imported. Defaults to an empty array.

      // Example
      let tb = new TadBear();
      alert(tb.TA_noteToDraft("0B99FBEB-E5D1-4A51-8130-3FAB6C418622-92147-0001245A3E66B009"));

    Returns string

TA_importNotesToDrafts

  • TA_importNotesToDrafts(p_strTerm?: string, p_strTag?: string, p_astrImportTags?: string[]): string[]
  • Import all non-trashed Bear notes into Drafts matching a simple search. A search term, and a single tag to restrict the search by can be passed to this function. All matching Bear notes are then imported into Drafts. The content of each matched Bear note is made the content of a new draft. Any tags in Bear for the note are added as tags in Drafts (no leading #), and the creation date is set to the creation date of the note from Bear. The function also supports adding additional tags to an imported draft. This is useful for adding source tags and imported tags. If no matching notes are found, the function returnsvoid, otherwise an array of the UUID of the new drafts is returned.

    Parameters

    • Optional p_strTerm: string

      a search term to be searched for. Defaults to an empty string.

    • Optional p_strTag: string

      a single tag to restrict the searching where only notes tagged with a tag of that name are searched through. Defaults to an empty string which is no tag constraint.

    • Optional p_astrImportTags: string[]

      an array of tag names to add to the draft when imported. Defaults to an empty array.

      // Example
      let tb = new TadBear();
      alert(tb.TA_notesToDraft("foo", "bar", ["bear", "imported"]));

    Returns string[]

TA_openNote

  • TA_openNote(p_strID?: string, p_strTitle?: string, p_strText?: string, p_strHeader?: string, p_bExcludeTrashed?: Boolean, p_bNewWindow?: Boolean, p_bFloat?: Boolean, p_bShowWindow?: Boolean, p_bOpenNote?: Boolean, p_bSelected?: Boolean, p_bPin?: Boolean, p_bEdit?: Boolean): BearNote
  • Retrieve the details for and optionally open a note in Bear. While the parameters are all option, you must populate at least one content parameter (the first three) to create a note. Returns void if no match is found.

    Parameters

    • Optional p_strID: string

      the unique identifier of the note to be opened. Defaults to an empty string.

    • Optional p_strTitle: string

      the title of the note to be opened. Defaults to an empty string.

    • Optional p_strText: string
    • Optional p_strHeader: string

      a header within the note. Defaults to an empty string.

    • Optional p_bExcludeTrashed: Boolean

      defaults to true, and when set to true excludes the opening of any matched note that is trashed.

    • Optional p_bNewWindow: Boolean

      defaults to false, but when set to true on the Mac, it will open the note in a new Bear window.

    • Optional p_bFloat: Boolean

      defaults to false, but when set to true on the Mac, it will make the external Bear window float above other windows.

    • Optional p_bShowWindow: Boolean

      defaults to false, but on the Mac, when set to true, it will force Bear's main window to open.

    • Optional p_bOpenNote: Boolean

      defaults to false, but when set to true it will display the note in Bear's main or external window.

    • Optional p_bSelected: Boolean

      defaults to false, but when set to true will cause the function to seek to return the note currently loaded into the Bear editor.

    • Optional p_bPin: Boolean

      defaults to false, but when set to true, it will mark the Bear note as pinned.

    • Optional p_bEdit: Boolean

      defaults to false, but when set to true, it will place the cursor inside Bear's note editor.

      // Example
      let tb = new TadBear();
      let objResult = tb.TA_openNote("0B99FBEB-E5D1-4A51-8130-3FAB6C418622-92147-0001245A3E66B009");
      alert(objResult.identifier);
      alert(objResult.title);
      alert(objResult.note);
      alert(objResult.modificationDate);
      alert(objResult.creationDate);
      alert(objResult.isTrashed);
      alert(objResult.tags.join("|"));

    Returns BearNote

TA_openTag

  • TA_openTag(p_strTagsCSV: string): void
  • Search for a term in Bear across all notes or for a notes tagged with a specific tag. While the openTag URL scheme documentation for Bear indicates that a comma separated list of tag names can be used, experimentation with the Bear online URL builder showed that only the first tag is used. If you wish to search for multiple tags, consider adding the tags prefixed by # into the search option for that function. Similarly, while the documentation indicates that Bear note data is returned, no data is returned on a successful API call for openTag. Again the search function will return note-related data.

    not_recommended

    Parameters

    • p_strTagsCSV: string

      a comma separated list of Bear tag names; though in actuality the API ignores anything after the first one.

      // Example
      let tb = new TadBear();
      let abnmdResults = tb.TA_openTag("foo,bar");
      alert(JSON.stringify(abnmdResults));

    Returns void

TA_parameterString

  • TA_parameterString(): string
  • Generate the parameter string with URL encoding. The function takes each defined parameter and builds the parameter string that would follow the ? in a URL call.

    // Example
    let tb = new TadBear();
    alert(tb.TA_parameterString());

    Returns string

TA_renameTag

  • TA_renameTag(p_strName: string, p_strNewName: string, p_bShowWindow?: Boolean): void
  • Rename an existing tag in Bear. The tag must not be associated with any locked notes. If it is, the tag may not be renamed.

    Parameters

    • p_strName: string

      the name of the tag to be renamed.

    • p_strNewName: string

      the new name of the tag being renamed.

    • Optional p_bShowWindow: Boolean

      defaults to false, but on the Mac, when set to true, it will force Bear's main window to open.

      // Example
      let tb = new TadBear();
      tb.TA_renameTag("foo");

    Returns void

TA_reset

  • TA_reset(): void
  • Resets the Bear instance to an initialised state. parameters and url attributes are reset ready for a call.

    // Example
    let tb = new TadBear();
    tb.TA_reset();

    Returns void

TA_search

  • TA_search(p_strTerm?: string, p_strTag?: string, p_bShowWindow?: Boolean): BearNoteMetaData[]
  • Search for a term in Bear across all notes or for a notes tagged with a specific tag.

    Parameters

    • Optional p_strTerm: string

      a search term to be searched for. Defaults to an empty string.

    • Optional p_strTag: string

      a single tag to restrict the searching where only notes tagged with a tag of that name are searched through. Defaults to an empty string which is no tag constraint.

    • Optional p_bShowWindow: Boolean

      defaults to false, but on the Mac, when set to true, it will force Bear's main window to open.

      // Example
      let tb = new TadBear();
      let abnmdResults = tb.TA_search("foo", "bar");
      alert(JSON.stringify(abnmdResults));

    Returns BearNoteMetaData[]

TA_selectArchive

  • TA_selectArchive(p_strSearch?: string, p_bShowWindow?: Boolean): void
  • Select the Archive sidebar item in Bear. The function can optionally provide a search filter to search that particular subset of Bear notes.

    Parameters

    • Optional p_strSearch: string

      the optional search filter to populate in the Bear app. Defaults to an empty string.

    • Optional p_bShowWindow: Boolean

      defaults to false, but on the Mac, when set to true, it will force Bear's main window to open.

      // Example
      let tb = new TadBear();
      tb.TA_selectArchive("foo");

    Returns void

TA_selectLocked

  • TA_selectLocked(p_strSearch?: string, p_bShowWindow?: Boolean): void
  • Select the locked sidebar item in Bear. The function can optionally provide a search filter to search that particular subset of Bear notes.

    Parameters

    • Optional p_strSearch: string

      the optional search filter to populate in the Bear app. Defaults to an empty string.

    • Optional p_bShowWindow: Boolean

      defaults to false, but on the Mac, when set to true, it will force Bear's main window to open.

      // Example
      let tb = new TadBear();
      tb.TA_selectLocked("foo");

    Returns void

TA_selectTag

  • TA_selectTag(): string
  • Select Bear tag. The user is shown a prompt with a button for each available tag from Bear. Selecting a tag return it. Cancelling will return null.

    // Example
    let tb = new TadBear();
    alert(tb.TA_selectTag());

    Returns string

TA_selectToday

  • TA_selectToday(p_strSearch?: string, p_bShowWindow?: Boolean): void
  • Select the locked sidebar item in Bear. The function can optionally provide a search filter to search that particular subset of Bear notes.

    Parameters

    • Optional p_strSearch: string

      the optional search filter to populate in the Bear app. Defaults to an empty string.

    • Optional p_bShowWindow: Boolean

      defaults to false, but on the Mac, when set to true, it will force Bear's main window to open.

      // Example
      let tb = new TadBear();
      tb.TA_selectToday("foo");

    Returns void

TA_selectTodo

  • TA_selectTodo(p_strSearch?: string, p_bShowWindow?: Boolean): void
  • Select the todo sidebar item in Bear. The function can optionally provide a search filter to search that particular subset of Bear notes.

    Parameters

    • Optional p_strSearch: string

      the optional search filter to populate in the Bear app. Defaults to an empty string.

    • Optional p_bShowWindow: Boolean

      defaults to false, but on the Mac, when set to true, it will force Bear's main window to open.

      // Example
      let tb = new TadBear();
      tb.TA_selectTodo("foo");

    Returns void

TA_selectTrash

  • TA_selectTrash(p_strSearch?: string, p_bShowWindow?: Boolean): void
  • Select the Trash sidebar item in Bear. The function can optionally provide a search filter to search that particular subset of Bear notes.

    Parameters

    • Optional p_strSearch: string

      the optional search filter to populate in the Bear app. Defaults to an empty string.

    • Optional p_bShowWindow: Boolean

      defaults to false, but on the Mac, when set to true, it will force Bear's main window to open.

      // Example
      let tb = new TadBear();
      tb.TA_selectTrash("foo");

    Returns void

TA_selectUntagged

  • TA_selectUntagged(p_strSearch?: string, p_bShowWindow?: Boolean): void
  • Select the untagged sidebar item in Bear. The function can optionally provide a search filter to search that particular subset of Bear notes.

    Parameters

    • Optional p_strSearch: string

      the optional search filter to populate in the Bear app. Defaults to an empty string.

    • Optional p_bShowWindow: Boolean

      defaults to false, but on the Mac, when set to true, it will force Bear's main window to open.

      // Example
      let tb = new TadBear();
      tb.TA_selectUntagged("foo");

    Returns void

TA_tags

  • TA_tags(): string[]
  • Return all the tags currently displayed in Bear's sidebar. The tags are returned as an array of tag names.

    // Example
    let tb = new TadBear();
    alert(tb.TA_tags().join(" | "));

    Returns string[]

TA_trashNote

  • TA_trashNote(p_strID: string, p_bShowWindow?: Boolean): void
  • Move a Bear note (based on its ID) to the trash in Bear.

    Parameters

    • p_strID: string

      the unique identifier of the note to be trashed.

    • Optional p_bShowWindow: Boolean

      defaults to false, but on the Mac, when set to true, it will force Bear's main window to open.

      // Example
      let tb = new TadBear();
      tb.TA_trashNote("42E4B1E2-4772-4859-B613-ABBEC5F6F494-92147-00011C1079276C26");

    Returns void

TA_url

  • TA_url(p_strAction: string): string
  • Generate the URL call string. The function generates a basic call URL for the action and available parameters.

    Parameters

    • p_strAction: string

      the name of the Bear URL action.

      // Example
      let tb = new TadBear();
      tb.parameters.term = "foo";
      alert(tb.TA_url("search"));

    Returns string