Hi Cole.
While there is not a mechanism to programmatically-add a trigger ID to an existing button, you can programmatically-add trigger IDs to arbitrary ogScript function calls with ogscript.addRemoteTrigger('TRIGGER_ID', 'TRIGGER_NAME', TRIGGER_FUNCTION);
Each time a trigger is added, an object is returned that contains a 'close' function. If you call the 'close' function, the added trigger will be deleted.
For example
function triggerFunction(event)
{
ogscript.debug('EVENT FIRED: ' + event.getTrigger());
}
var added = new Array();
for (var i = 0; i < 2000; i++)
{
added.push(ogscript.addRemoteTrigger('Trigger ' + (i + 1), 'Number ' + (i + 1), triggerFunction));
}
ogscript.putObject('script-gpi', added);
And, to remove them (optionally):
var obj = ogscript.getObject('script-gpi');
if (obj != null)
{
for (var i = 0; i < obj.length; i++)
{
obj[i].close();
}
}
#DashBoard