where Store Macro

  • As far as I know you still can't ask questions via command line directly. However you can do it via a or Macro or Lua.


    A one liner lua script would be something like:


    lua'local c="Store Executor " .. TextInput("Where Store?"); Cmd(c)'


    This used the TextInput() API to ask the user a question and store it in the variable c. If the user enters 201 that should result in Store Executor 201 on the command line You could also specify the page.executor with a little editing.


    The only real issue with using this is if the user enters text and not a number, odd things may happen. This could be avoided by using string.format() to tonumber() as in the above link, causing text to return nil and causing the command to fail, but this is clearer to read.


    Like this:


    lua'local c="Store Executor " .. tonumber(TextInput("Where Store?")); Cmd(c)'


    If you enter "Pizza" the command will error out.

    Edited once, last by hoss: Clarify potential issue with using the first lua script. ().