actualNoteContentPart: ## app.alert
  Show the user a message. The name of the plugin is shown in the title of the dialog. Similar to app.prompt, except that this doesn't offer inputs, and instead offers "actions", which are buttons the user can pick at the bottom of the notification.
  Arguments
  	message the String to show the user. Use "\n" to output new lines. Unicode characters are supported. Markdown is not (yet).
  	(optional) object describing additional options, containing any of the following properties:
  		actions optional Array of action objects that will be added as buttons on the dialog. Each action object can have the following properties:
  			icon optional String name of a [Material Icon](https://fonts.google.com/icons?icon.set=Material+Icons)  to show on the button
  			label the String text to show on the button
  			value optional value (of any basic JS type) that will be returned when the action is triggered, instead of the index in the actions array
  		preface a String to show [before the main message](https://images.amplenote.com/fae505fa-bd40-11ed-8e3b-9a67e5fef0db/53d98444-82b5-46c4-888a-ac47da8bfa74.png)  
  		primaryAction an object describing the presentation of the rightmost button on the dialog (the "DONE" button), with the following properties:
  			icon optional String name of a [Material Icon](https://fonts.google.com/icons?icon.set=Material+Icons)  to show on the button
  			label the String text to show on the button
  		scrollToEnd a boolean indicating whether the message shown to the user should be scrolled down so the end is visible, if it is long enough that the alert dialog has a scrollbar
  Returns
  	null if the user dismisses the dialog 
  	-1 if the user presses the "DONE" button (or the primaryAction button, if supplied)
  	If options.actions is provided:
  		The integer index corresponding to the action the user selected, or - if the selected action includes a value key, the value associated with the value key.
  
  ```
  {  noteOption(app, noteUUID) {    app.alert("This is an alert");  }}
  ```
  
  
  
  
  
  ```
   {  async noteOption(app, noteUUID) {    const actionIndex = await app.alert("This is an alert", {      actions: [        { icon: "post_add", label: "Insert in note" }      ]    });     if (actionIndex === 0) {      // "Insert in note"    }  }}
  ```
  
  
  
  
  
  ## app.attachNoteMedia
  Upload a media file, associating it with a the specified note. This function uploads the file directly, so the user must be online for it to work, and it may take a long time, depending on the size of the media and connectivity.
  Arguments
  	[noteHandle](/help/developing_amplenote_plugins/appendix_i#noteHandle)  describing the note to attach the media to
  	dataURL a [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs)  describing the media file data
  Returns
  	String URL of uploaded media
  Throws
  	If the media file is too large, or otherwise not allowed
  	If there are network errors that prevent upload
  ```
  {  async insertText(app) {    const noteHandle = { uuid: app.context.noteUUID };     const response = await fetch("https://source.unsplash.com/featured/300x200");    const blob = await response.blob();    const dataURL = await this._dataURLFromBlob(blob);     const fileURL = await app.attachNoteMedia(noteHandle, dataURL);     app.context.replaceSelection(`![](${ fileURL })`);    return null;  },   _dataURLFromBlob(blob) {    return new Promise((resolve, reject) => {      const reader = new FileReader();       reader.onload = event => {        resolve(event.target.result);      };       reader.onerror = function(event) {        reader.abort();        reject(event.target.error);      };       reader.readAsDataURL(blob);    });  }}
  ```
processedNoteContent: ---
  title: App Interface: Plugin methods to interact with ...
  headers: ## app.alert
  ---
  app.alert
  Show the user a message. The name of the plugin is shown in the title of the dialog. Similar to app.prompt, except that this doesn't offer inputs, and instead offers "actions", which are buttons the user can pick at the bottom of the notification.
  Arguments
  message the String to show the user. Use "\n" to output new lines. Unicode characters are supported. Markdown is not (yet).
  (optional) object describing additional options, containing any of the following properties:
  actions optional Array of action objects that will be added as buttons on the dialog. Each action object can have the following properties:
  icon optional String name of a [Material Icon](https://fonts.google.com)`
    to show on the button
  label the String text to show on the button
  value optional value (of any basic JS type) that will be returned when the action is triggered, instead of the index in the actions array
  preface a String to show [before the main message](https://images.amplenote.com)`
  
  primaryAction an object describing the presentation of the rightmost button on the dialog (the "DONE" button), with the following properties:
  icon optional String name of a [Material Icon](https://fonts.google.com)`
    to show on the button
  label the String text to show on the button
  scrollToEnd a boolean indicating whether the message shown to the user should be scrolled down so the end is visible, if it is long enough that the alert dialog has a scrollbar
  Returns
  null if the user dismisses the dialog
  -1 if the user presses the "DONE" button (or the primaryAction button, if supplied)
  If options.actions is provided:
  The integer index corresponding to the action the user selected, or - if the selected action includes a value key, the value associated with the value key. {  noteOption(app, noteUUID) {    app.alert("This is an alert");  }}
   {  async noteOption(app, noteUUID) {    const actionIndex = await app.alert("This is an alert", {      actions: [        { icon: "post_add", label: "Insert in note" }      ]    });     if (actionIndex === 0) {      // "Insert in note"    }  }}
  
  app.attachNoteMedia
  Upload a media file, associating it with a the specified note. This function uploads the file directly, so the user must be online for it to work, and it may take a long time, depending on the size of the media and connectivity.
  Arguments
  [noteHandle](/help/developing_amplenote_plugins/appendix_i#noteHandle)
    describing the note to attach the media to
  dataURL a [data URL](https://developer.mozilla.org)`
    describing the media file data
  Returns
  String URL of uploaded media
  Throws
  If the media file is too large, or otherwise not allowed
  If there are network errors that prevent upload {  async insertText(app) {    const noteHandle = { uuid: app.context.noteUUID };     const response = await fetch("https://source.unsplash.com/featured/300x200");    const blob = await response.blob();    const dataURL = await this._dataURLFromBlob(blob);     const fileURL = await app.attachNoteMedia(noteHandle, dataURL);     app.context.replaceSelection(`![](${ fileURL })`);    return null;  },   _dataURLFromBlob(blob) {    return new Promise((resolve, reject) => {      const reader = new FileReader();       reader.onload = event => {        resolve(event.target.result);      };       reader.onerror = function(event) {        reader.abort();        reject(event.target.error);      };       reader.readAsDataURL(blob);    });  }}
noteTitle: App Interface: Plugin methods to interact with user notes