actualNoteContentPart: # Plugin API Reference Documentation: App interface
  The app interface provides the means of interacting with the application. It is passed to all plugin action functions as the first argument. All app interface functions should be considered asynchronous, returning a Promise that will either resolve to the result, or reject if there is an error.
  
  ## Retrieving App Interface as a markdown document for LLMs
  When referencing this page via an LLM, it can be faster to retrieve the page via its pure markdown version: [https://public.amplenote.com/C8TUXf394zsvrGn8NwXgoJ7f.md](https://public.amplenote.com/C8TUXf394zsvrGn8NwXgoJ7f.md)  
  
  ## app.addNoteTag
  Add a tag to a note.
  Arguments
  	[noteHandle](/help/developing_amplenote_plugins/appendix_i#noteHandle)  identifying the note to add the tag to
  	String text of the tag to add - note that this will be normalized to conform to allowed tag names (lowercase, dashes), if it is not a valid tag name
  Returns
  	boolean indicating whether the tag was added. In some cases, shared tags cannot be added to notes - and this will return false.
  Throws
  	If the given tag argument is not a string
  ```
  {  async noteOption(app, noteUUID) {    const added = await app.addNoteTag({ uuid: noteUUID }, "some-tag");    await app.alert(added ? "Tag added" : "Failed to add tag");  }} 
  ```
  
  ## app.addTaskDomainNote
  Ensure the specified note is included in the specified task domain. If the note is already included in the task domain by virtue of a tag the note has, the note will be included directly in the task domain such that removing the tag from the note will leave it in the task domain.
  Arguments
  	String task domain UUID, which can be obtained by calling [app.getTaskDomains](/help/developing_amplenote_plugins/app_interface#app.getTaskDomains)  
  	[noteHandle](/help/developing_amplenote_plugins/appendix_i#noteHandle)  identifying the note to add to the task domain. Will not create a new note if the note handle describes a note that does not yet exist.
  Returns
  	boolean indicating whether the note was added to the task domain (or is already included in the task domain). A return value of false generally indicates an issue with the note handle (e.g. it identifies a note that doesn't exist, is malformed, etc).
  Throws
  	If the given task domain UUID does not correspond to any task domain
  ```
  {  async noteOption(app, noteUUID) {    const taskDomains = await app.getTaskDomains();    const taskDomain = taskDomains[0];    const added = await app.addTaskDomainNote(taskDomain.uuid, { uuid: noteUUID });    await app.alert(added ? "Note added to first task domain" : "Failed to add note");  }} 
  ```
processedNoteContent: ---
  title: App Interface: Plugin methods to interact with ...
  tags: 
  headers: # Plugin API Reference Documentation: App interface
  ---
  Plugin API Reference Documentation: App interface
  The app interface provides the means of interacting with the application. It is passed to all plugin action functions as the first argument. All app interface functions should be considered asynchronous, returning a Promise that will either resolve to the result, or reject if there is an error. 
  Retrieving App Interface as a markdown document for LLMs
  When referencing this page via an LLM, it can be faster to retrieve the page via its pure markdown version: [https://public.amplenote.com/C8TUXf394zsvrGn8NwXgoJ7f.md](https://public.amplenote.com)`
  
  app.addNoteTag
  Add a tag to a note.
  Arguments
  [noteHandle](/help/developing_amplenote_plugins/appendix_i#noteHandle)
    identifying the note to add the tag to
  String text of the tag to add - note that this will be normalized to conform to allowed tag names (lowercase, dashes), if it is not a valid tag name
  Returns
  boolean indicating whether the tag was added. In some cases, shared tags cannot be added to notes - and this will return false.
  Throws
  If the given tag argument is not a string {  async noteOption(app, noteUUID) {    const added = await app.addNoteTag({ uuid: noteUUID }, "some-tag");    await app.alert(added ? "Tag added" : "Failed to add tag");  }} 
  
  app.addTaskDomainNote
  Ensure the specified note is included in the specified task domain. If the note is already included in the task domain by virtue of a tag the note has, the note will be included directly in the task domain such that removing the tag from the note will leave it in the task domain.
  Arguments
  String task domain UUID, which can be obtained by calling [app.getTaskDomains](/help/developing_amplenote_plugins/app_interface#app.getTaskDomains)
  
  [noteHandle](/help/developing_amplenote_plugins/appendix_i#noteHandle)
    identifying the note to add to the task domain. Will not create a new note if the note handle describes a note that does not yet exist.
  Returns
  boolean indicating whether the note was added to the task domain (or is already included in the task domain). A return value of false generally indicates an issue with the note handle (e.g. it identifies a note that doesn't exist, is malformed, etc).
  Throws
  If the given task domain UUID does not correspond to any task domain {  async noteOption(app, noteUUID) {    const taskDomains = await app.getTaskDomains();    const taskDomain = taskDomains[0];    const added = await app.addTaskDomainNote(taskDomain.uuid, { uuid: noteUUID });    await app.alert(added ? "Note added to first task domain" : "Failed to add note");  }}
noteTitle: App Interface: Plugin methods to interact with user notes