Retrieving the optional args when a plugin is called from a macro

Macros can call plugins with optional arguments using the run(“pluginName”, “optional Args”) macro command. In this how-to, Wayne Rasband explains how to capture the optional arguments in the plugin run method.

Here is an exchange between a newsgroup subscriber and Wayne Rasband about capturing the optional arguments passed from a macro to a plugin via the run() macro command. The original post has been edited slightly to keep it short.

On Jan 14, 2005, at 9:10 AM, <name removed> wrote:
  How do I pass an argument from a macro to a plugin that implements 'PlugIn'? 
  
  I would expect that the macro statement
  
  run("myPlugin ", "myArgument");

  would pass "myArgument" as an argument of the 'run' method inside the plugin
  myPlugin '. But that does not happen (the 'run' method receives an
  empty java.lang.String).

  A plugin can retrieve the options string passed to the run() function
  by calling Macro.getOptions().

  -wayne
howto/plugins/retrieving_the_optional_args_when_a_plugin_is_called_from_a_macro.txt · Last modified: 2010/01/27 13:07 by glandini
Back to top
CC Attribution-Noncommercial-Share Alike 3.0 Unported
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0