actualNoteContentPart: ## insertText
  Called to insert text at a specific location in a note, when using an {expression}. 
  Arguments
  	app [App Interface](/help/developing_amplenote_plugins/app_interface)  
  Returns
  	String new text to insert in the note in place of the {expression}
  ```
  {  insertText(app) {    return "hello world";  }} 
  ```
  The auto-complete menu for expression will include any installed plugins:
  
  
  
  
  The plugin's insertText action will be called to replace the {Test Plugin} expression, where "Test Plugin" is the configured plugin [name](/help/developing_amplenote_plugins#name) . 
  
  To use a different keyword than the plugin's name, return a string from the check function:
  ```
   {  insertText: {    check(app) {      return "keyword";    },    run(app) {      return "hello world";    }  }} 
  ```
  
  
  
  
  
  ## linkOption
  Adds a button to the Rich Footnote popup, shown when the cursor is in a specific link.
  Arguments
  	app [App Interface](/help/developing_amplenote_plugins/app_interface)  
  	link [link](/help/developing_amplenote_plugins/appendix_i#link)  object describing the link the action was triggered from
  Returns
  	Nothing
  ```
   {   linkOption(app, link) {     const newDescription = (link.description || "") + "\n\nmore";     app.context.updateLink({ description: newDescription });   } }
  ```
  
  
  
  
  
  ## linkTarget
  A plugin's linkTarget action will be called when a plugin link (plugin://<plugin UUID>) is clicked/pressed, either via the link icon in a note or the link icon/text in a Rich Footnote popup. A plugin's UUID is included in all actions as app.context.pluginUUID.
  Arguments
  	app [App Interface](/help/developing_amplenote_plugins/app_interface)  
  	(optional) String query string included in the plugin link URL, not including the leading ?, e.g. "something" for "plugin://<plugin UUID>?something"
  Returns
  	Nothing
  ```
   {   async linkTarget(app, ...args) {     await app.alert("link " + JSON.stringify(args));   } }
  ```
  
  The plugin can then be triggered from a link:
  
  
  
  
  To insert a link, use any app function that can receive markdown:
  ```
  {  async insertText(app) {    await app.context.replaceSelection(`[plugin link](plugin://${ app.context.pluginUUID }?blah`);    return null;  }}
  ```
  
  ## noteOption
  Adds options to the per-note menu, shown when editing a specific note.
  Arguments
  	app [App Interface](/help/developing_amplenote_plugins/app_interface)  
  	noteUUID the UUID of the note that the menu option was invoked in
  Returns
  	Nothing
  ```
  {  noteOption(app, noteUUID) {    app.alert(noteUUID);  }}
  ```
  
  
  
  
  
  ## onEmbedCall
  Called when code running in an embed that was rendered by this plugin (see [renderEmbed](/help/developing_amplenote_plugins/actions#renderEmbed) ) calls window.callAmplenotePlugin. 
  Arguments
  	app [App Interface](/help/developing_amplenote_plugins/app_interface)  
  	...args any arguments passed to window.callAmplenotePlugin - note that these arguments are serialized to JSON then deserialized to Javascript values, so they should be able to round-trip through a JSON serialize/deserialize.
  Returns
  	Any Javascript value that can be serialized as JSON, which will be deserialized before it is resolved as the result of the promise returned by window.callAmplenotePlugin in the embed.
  
  ```
  {  onEmbedCall(app, ...args) {    console.log("onembedcall", args)    return 42;  }}
  ```
  See [calling the plugin from the embed](/help/developing_amplenote_plugins#Calling_the_plugin_from_the_embed)  for a more detailed example.
processedNoteContent: ---
  title: Actions: Ways to invoke/initiate plugin execution
  headers: ## insertText
  ---
  insertText
  Called to insert text at a specific location in a note, when using an {expression}.
  Arguments
  app [App Interface](/help/developing_amplenote_plugins/app_interface)
  
  Returns
  String new text to insert in the note in place of the {expression} {  insertText(app) {    return "hello world";  }} 
  The auto-complete menu for expression will include any installed plugins: The plugin's insertText action will be called to replace the {Test Plugin} expression, where "Test Plugin" is the configured plugin [name](/help/developing_amplenote_plugins#name)
   . To use a different keyword than the plugin's name, return a string from the check function:  {  insertText: {    check(app) {      return "keyword";    },    run(app) {      return "hello world";    }  }} 
  
  linkOption
  Adds a button to the Rich Footnote popup, shown when the cursor is in a specific link.
  Arguments
  app [App Interface](/help/developing_amplenote_plugins/app_interface)
  
  link [link](/help/developing_amplenote_plugins/appendix_i#link)
    object describing the link the action was triggered from
  Returns
  Nothing  {   linkOption(app, link) {     const newDescription = (link.description || "") + "\n\nmore";     app.context.updateLink({ description: newDescription });   } }
  
  linkTarget
  A plugin's linkTarget action will be called when a plugin link (plugin:// 
  ) is clicked/pressed, either via the link icon in a note or the link icon/text in a Rich Footnote popup. A plugin's UUID is included in all actions as app.context.pluginUUID.
  Arguments
  app [App Interface](/help/developing_amplenote_plugins/app_interface)
  
  (optional) String query string included in the plugin link URL, not including the leading ?, e.g. "something" for "plugin:// 
  ?something"
  Returns
  Nothing  {   async linkTarget(app, ...args) {     await app.alert("link " + JSON.stringify(args));   } }
  The plugin can then be triggered from a link: To insert a link, use any app function that can receive markdown: {  async insertText(app) {    await app.context.replaceSelection(`[plugin link](plugin://${ app.context.pluginUUID }?blah`);    return null;  }}
  
  noteOption
  Adds options to the per-note menu, shown when editing a specific note.
  Arguments
  app [App Interface](/help/developing_amplenote_plugins/app_interface)
  
  noteUUID the UUID of the note that the menu option was invoked in
  Returns
  Nothing {  noteOption(app, noteUUID) {    app.alert(noteUUID);  }}
  
  onEmbedCall
  Called when code running in an embed that was rendered by this plugin (see [renderEmbed](/help/developing_amplenote_plugins/actions#renderEmbed)
   ) calls window.callAmplenotePlugin.
  Arguments
  app [App Interface](/help/developing_amplenote_plugins/app_interface)
  
  ...args any arguments passed to window.callAmplenotePlugin - note that these arguments are serialized to JSON then deserialized to Javascript values, so they should be able to round-trip through a JSON serialize/deserialize.
  Returns
  Any Javascript value that can be serialized as JSON, which will be deserialized before it is resolved as the result of the promise returned by window.callAmplenotePlugin in the embed. {  onEmbedCall(app, ...args) {    console.log("onembedcall", args)    return 42;  }}
  See [calling the plugin from the embed](/help/developing_amplenote_plugins#Calling_the_plugin_from_the_embed)
    for a more detailed example.
noteTitle: Actions: Ways to invoke/initiate plugin execution