Macro pop-up

  • Hi!
    What is the syntax to create a pop-up in a macro to call a group or preset?
    In MA2 it is (), but in MA3 the value that is written in the pop-up appear in quotation marks.


  • As usual, LUA to the rescue.

    As a work around you could do something like this:

    Lua'local x = tonumber(TextInput("Group?")); Cmd("Group " .. x);'

    Lua has a tonumber function that tries to take a string and convert it to a int or float.

    If you entered a string like "six" this would cause a LUA error. so slightly modifying it to:

    Lua'local x = tonumber(TextInput("Group?")); if x ~= nil then Cmd("Group " .. x)end;' 

    Would not cause the error, and just not do anything if you did not enter a number.

  • as Lua alternative, the following should be sufficient:

    Lua "Cmd('Group ' .. TextInput('Group?')"

    converting to number is in this scenario a detour, as concatenating effectively converts x back to a string.

  • I tryed the following plugin, what is wrong? It only executes the TextInput, but after that nothing [and yes I executed the StorequestionAppearance()]


    LUA Runtime Error :9: bad argument #1 to 'tonumber' (value expected)

    My Input is just a number like 100

    My Input into the AppearanceStartIndex is 100