actualNoteContentPart: ### Inline embeds with parameters
  ```
  <object data="plugin://UUID?something=1&else=2" />
  ```
  will call embedPlugin like this
  ```
  renderEmbed(app, "something=1&else=2") 
  ```
  
  ### Calling the plugin from the embed
  The code running in the embed can call out to the plugin itself, and the plugin code can return values back to the embed from this call. Within the embed itself, a call can be made to the controlling plugin (the plugin that renderEmbed was called on) by using window.callAmplenotePlugin:
  ```
  window.callAmplenotePlugin("test", 1, [ 2, 3 ]).then(result => {  console.log("gots", result);});
  ```
  Any arguments will be passed to the plugin's [onEmbedCall](/help/developing_amplenote_plugins/actions#onEmbedCall)  after the app argument.
  
  Putting together onEmbedCall and window.callAmplenotePlugin, we can implement a basic plugin that renders an embed with a button. When the button is clicked, the embed calls into the plugin to show the user a prompt, returning the result to the embed:
  ```
  {  renderEmbed(app, ...args) {    return `      <b>hello</b> from a plugin <button>call host</button>      <script type="text/javascript">        var button = document.querySelector("button");        button.addEventListener("click", function() {          window.callAmplenotePlugin().then(result => {            button.textContent = "Got: " + result;          })        });      </script>    `;  },   async onEmbedCall(app, ...args) {    return await app.prompt("enter something");  },}
  ```
  
  
  
  
  
  Upon clicking the "call host" button:
  
  
  
  
  
  After clicking "submit":
  
  
  
  
  
  
  ## replaceText
  Called to replace some highlighted text, invoked via the selection menu.
  Arguments
  	app [App Interface](/help/developing_amplenote_plugins/app_interface)  
  	text the String of selected text
  Returns
  	String new text to replace the selected text with
  	null to cancel the replacement. Note that the replacement will also be cancelled if the user changes the selection before this action returns a value.
  ```
  {  replaceText(app, text) {    return "new text";  }}
  ```
  
  
  
  
  
  
  To use a different keyword than the plugin's name, return a string from the check function:
  ```
   {  replaceText: {    check(app, text) {      return "some text";    },    run(app, text) {      return "new text";    }  }}
  ```
  This code will result in the returned check function text being displayed to the user:
  
  
  
  
  
  
  ## taskOption
  Adds options to the task commands menu (invoked when typing ! in the body of a task).
  Arguments
  	app [App Interface](/help/developing_amplenote_plugins/app_interface)  
  	[task](/help/developing_amplenote_plugins/appendix_i#task)  the task the option was invoked on
  Returns
  	Nothing
  ```
  {  taskOption(app, task) {    app.alert(JSON.stringify(task));  }} 
  ```
  
  
  
  
  
  
  ## validateSettings
  When plugin settings are saved, this presents an opportunity to ensure that the settings are correctly set up, e.g. if the user is entering an API key for a third-party service, it can be validated to present the user with a message if it is not a valid API key.
  Arguments
  	app [App Interface](/help/developing_amplenote_plugins/app_interface)  - note that is is a very limited app interface, without the vast majority of the typical app interface functions
  	settings the settings Object that has been saved. Note that app.settings will reflect any changes as well, matching this argument.
  Returns
  	An array of strings describing issues with the settings, or any false-y value to indicate that there are no problems with the settings.
  ```
  {  validateSettings(app, settings) {    return [ "Settings are not valid" ];  }}
  ```
processedNoteContent: ---
  title: Actions: Ways to invoke/initiate plugin execution
  headers: ### Inline embeds with parameters
  ---
  Inline embeds with parameters
  <object data="plugin://UUID?something=1&else=2" />
  will call embedPlugin like this renderEmbed(app, "something=1&else=2") 
  
  Calling the plugin from the embed
  The code running in the embed can call out to the plugin itself, and the plugin code can return values back to the embed from this call. Within the embed itself, a call can be made to the controlling plugin (the plugin that renderEmbed was called on) by using window.callAmplenotePlugin: window.callAmplenotePlugin("test", 1, [ 2, 3 ]).then(result => {  console.log("gots", result);});
  Any arguments will be passed to the plugin's [onEmbedCall](/help/developing_amplenote_plugins/actions#onEmbedCall)
    after the app argument. Putting together onEmbedCall and window.callAmplenotePlugin, we can implement a basic plugin that renders an embed with a button. When the button is clicked, the embed calls into the plugin to show the user a prompt, returning the result to the embed: {  renderEmbed(app, ...args) {    return `      <b>hello</b> from a plugin <button>call host</button>      <script type="text/javascript">        var button = document.querySelector("button");        button.addEventListener("click", function() {          window.callAmplenotePlugin().then(result => {            button.textContent = "Got: " + result;          })        });      </script>    `;  },   async onEmbedCall(app, ...args) {    return await app.prompt("enter something");  },}
  Upon clicking the "call host" button: After clicking "submit": 
  replaceText
  Called to replace some highlighted text, invoked via the selection menu.
  Arguments
  app [App Interface](/help/developing_amplenote_plugins/app_interface)
  
  text the String of selected text
  Returns
  String new text to replace the selected text with
  null to cancel the replacement. Note that the replacement will also be cancelled if the user changes the selection before this action returns a value. {  replaceText(app, text) {    return "new text";  }}
  To use a different keyword than the plugin's name, return a string from the check function:  {  replaceText: {    check(app, text) {      return "some text";    },    run(app, text) {      return "new text";    }  }}
  This code will result in the returned check function text being displayed to the user: 
  taskOption
  Adds options to the task commands menu (invoked when typing ! in the body of a task).
  Arguments
  app [App Interface](/help/developing_amplenote_plugins/app_interface)
  
  [task](/help/developing_amplenote_plugins/appendix_i#task)
    the task the option was invoked on
  Returns
  Nothing {  taskOption(app, task) {    app.alert(JSON.stringify(task));  }} 
  
  validateSettings
  When plugin settings are saved, this presents an opportunity to ensure that the settings are correctly set up, e.g. if the user is entering an API key for a third-party service, it can be validated to present the user with a message if it is not a valid API key.
  Arguments
  app [App Interface](/help/developing_amplenote_plugins/app_interface)
    - note that is is a very limited app interface, without the vast majority of the typical app interface functions
  settings the settings Object that has been saved. Note that app.settings will reflect any changes as well, matching this argument.
  Returns
  An array of strings describing issues with the settings, or any false-y value to indicate that there are no problems with the settings. {  validateSettings(app, settings) {    return [ "Settings are not valid" ];  }}
noteTitle: Actions: Ways to invoke/initiate plugin execution