Passing data to installed scripts

LuaFAR for Editor

Passing data to installed scripts


An installed script, when it is run conventionally, always receives a single argument of table type.

Scripts installed via AddToMenu call (run from plugin menu or shortcut)

  • The array part of the table contains the additional arguments specified in the AddToMenu call.
  • The hash part of the table has the field From that contains either of the following strings: “config”, “dialog”, “editor”, “panels” or “viewer”.
  • In the case From=="dialog", the table also has the field hDlg, that contains the dialog handle (a userdata value).

Scripts installed via AddCommand call (run via plugin command)

  • The array part of the table contains the additional arguments specified in the AddCommand call followed by the command line arguments.
  • The hash part of the table has the field From that contains the string “panels”.