There are two problems I can see in your script - one is an actual bug that could crash SMTD UI, and the other is a logical issue.
When setting the list, you need to create an ARRAY, so the event handler of the Select button would need to be
on _RNode_Button pressed do
(
SMTDSettings.SlavesList = #(_RNodes.selected) --> note the #() surrounding the name of the slave
print (SMTDSettings.SlavesList)
)
The logical issue is that the UI you wrote claims to be setting the Whitelist, but in fact it is defining the Blacklist. So the node you are selecting is the one that will NOT render. This is what SMTDSettings.SlavesBlackList=true defines. When it is true, the SMTDSettings.SlaveList is used as a Black List. When set to false, it is used as a White List.
The first error did not crash the SMTDFunctions function writing the JOB file because the relevant code there is
if SMTDSettings.SlavesList.count > 0 do
(
local theKeyword = if SMTDSettings.SlavesBlackList then "Blacklist" else "Whitelist"
local theSlaveListString = ""
for i = 1 to SMTDSettings.SlavesList.count-1 do
theSlaveListString += SMTDSettings.SlavesList[i] + ","
theSlaveListString += SMTDSettings.SlavesList[SMTDSettings.SlavesList.count]
format "%=%\n" theKeyword theSlaveListString to:submitInfoFile
)
So the IF statement checks SMTDSettings.SlavesList.count > 0, so it is checking the number of characters in the string you assigned because it was not an array. When a variable contains a string instead of an array, MAXScript can access the individual characters of the string as array elements.
As result, the Blacklist would have been set to the name of the slave, split into characters delimited by commas. E.g., if the slave was called “MySlave01”, the output to the JOB file would look like
Blacklist=M,y,S,l,a,v,e,0,1
Since none of these letters represents an actual slave to blacklist, and you are defining a Black list instead of a White list, all actual slaves were technically WHITE LISTED Had you flipped the setting to SMTDSettings.SlavesBlackList=false, then NONE of your machines would have been used because the Whitelist would have been set to M,y,S,l,a,v,e,0,1…
Hopefully fixing the above problems will make the script work as you expect it to!