There are 3 ways to do this:
_global.RunScript = function(the_script) {
RunScipts = 'If'+' RunScript("\\macros\\'+_root.Profile+'\\'+the_script+'") < 0 Then '+"\r"+'MsgBox "ERROR! Cannot Locate Script:'+' macros\\'+_root.Profile+'\\'+the_script+'" '+"\r"+'End If ';
fscommand("VBMacro", RunScipts);
};
On every button place(where LoadGCode is the name of you macro) :
on (release) {
RunScript("LoadGCode");
}
or
Set the value of a var using +"\r"+ to add the return lines :
Runstart = 'If'+' RunScript("\\macros\\'+_root.Profile+'\\'+"CycleStart"+'") < 0 Then '+"\r"+'DoOEMButton(1000) '+"\r"+'End If ';
fscommand("VBMacro", Runstart);
or
In you will need a text box with VB code in it and name the text box for example to Edge1:
on (release) {
fscommand("VBMacro", Edge1.text);
}
Let me know if this helps, I can upload examples if needed.