RunUserItem

LuaFAR for Editor

RunUserItem


results = RunUserItem (Item, Properties, ...)

Parameters:
  Item:       table
                filename: string; script file specification
                env:      table; environment to run the script in
                arg:      table; array of arguments associated with Item

  Properties: table
                From:     string ("config", "dialog", "editor", "panels" or "viewer")
                hDlg:     userdata (dialog handle), or nil

  ... :       sequence of additional arguments (appended to existing arguments)

Returns:
  results:    zero or more Lua values

Description:

  The function runs user's menu item, created as a result of execution of AddToMenu.

  Item.filename is a specification for a Lua script to run upon this item activation.
  The exact file name is determined according to the same rules as with `require` function,
  that is, `package.path` is used to search for the file. But contrary to `require`,
  the value returned by the script is not cached in `package.loaded`.

  For the script's input arguments, see Passing data to installed scripts.