I am afraid you are still not understanding the concept of a "replacement variable" containined in a string. And since what you want is so easily done as shown below, I doubt Allonis will have much enthusiasm for your new feature suggestion.
So let me try to explain again.
Computer commands are usually given in an english text sentence, containing letters formatted into words in a specified order. The computer does not understand this, it does not know what needs to be done until that sentence has been translated into "machine language", and into individual steps that will accomplish the task. This coversion from english to machine is usually called "Compiling", but sometimes also refered to as "interpreting" or "processing". The english statement is translated, and the individual steps needed are identified to the computer.
The string replacement variables are dealt with prior to the start of that "compile" phase. Replacement variables are only handled in this "preproccesing" stage. The script you give to the computer to process is searched to see if there are any replacement variables contained in it, and if so, the replacement string is substituted for the replacement variable. After ALL of the replacement variables have been replaced, that modified script is then presented to be compiled, processed, and ran.
Getting to your issue with your button, where you have a need to have a button that needs to have different scripts in it depending on different situations. You accomplish what you want to do by creating two separate Server Macros contaiing those different scripts. In your button, you specify that button to call a macro, but the macro name specified will be a replacement variable. Then you set the replacement variable value itself with the names of either one of those two macros, as you require.
Example:
Macro Tweedledum:
Macro|<some useful script statements here>
Macro Tweedledee:
Macro|<some different script statments here>
You then create a server variable (lets call it "Tweed") that contains the actual maacro name. At some point, you run a statment that does:
SetVariable|Tweed~Tweedledum!
In your button script, you then simply have:
Macro|{{Tweed}}!
At the time of execution, Allonis will take the statement "Macro|{{Tweed}}" and replace "{{Tweed}}" with "Tweedledum", and then repeat that script processing with that modified script (i.e "Macro|Tweedledum!")
Understanding the above is essential, so please ask again, if any part of the above is still confusing. You will get there.
Please Log in or Create an account to join the conversation.