Very Cool stuff, but what I require can't be onSelected. Ive made this since then from a dbl-drop-down macro, as I just can't give up on coding once I start. Add in that I suck, and it's exhausting. (And yes, once I get the layer change working, I'm going to sub in tokenID variables so I can run fewer functions). It doesn't error out on save. When I run the macro, it plays the sound but doesn't move the objects to the objects(token) layer. when I enter that "!token" line directly into chat, it works like a charm. Token changes layers. WTH? Do you see where I'm making the error? I dont ___________ on("chat:message",function(msg){ if(msg.type=="api" && msg.content.indexOf("!Caution")==0){ var args = msg.content.split(/\s+/); var cautionType = args[1]; var toggle = args[2]; switch(cautionType){ case "ObsDet": ObsDet(toggle); break; case "Scan": Scan(toggle); break; case "IFF": IFF(toggle); break; case "SenserLock": SenserLock(toggle); break; case "Fuel": Fuel(toggle); break; case "Antenna": Antenna(toggle); break; case "Clear": Clear(toggle); break; } } }); function ObsDet(toggle){ if(toggle == "on"){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|objects"); sendChat("API","!token-mod --ids -NiyJkQufZE-vGhsfxOq --set layer|objects"); sendChat("API","!roll20AM --audio,play|Beeping"); } if(toggle == "off"){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|gmlayer"); sendChat("API","!token-mod --ids -NiyJkQufZE-vGhsfxOq --set layer|gmlayer"); } } function Scan(toggle){ if(toggle == "on"){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|objects"); sendChat("API","!token-mod --ids -NiyJkTaqbIjgPdKGBQE --set layer|objects"); sendChat("API","!roll20AM --audio,play|Beeping"); } if(toggle == "off"){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|gmlayer"); sendChat("API","!token-mod --ids -NiyJkTaqbIjgPdKGBQE --set layer|gmlayer"); } } function IFF(toggle){ if(toggle == "on"){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|objects"); sendChat("API","!token-mod --ids -NiyJkTNTvmWlTMtFj2H --set layer|objects"); sendChat("API","!roll20AM --audio,play|Beeping"); } if(toggle == "off"){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|gmlayer"); sendChat("API","!token-mod --ids -NiyJkTNTvmWlTMtFj2H --set layer|gmlayer"); } } function SenserLock(toggle){ if(toggle == "on"){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|objects"); sendChat("API","!token-mod --ids -NiyJkUYTs5qJZkYAVM_ --set layer|objects"); sendChat("API","!roll20AM --audio,play|Beeping"); } if(toggle == "off"){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|gmlayer"); sendChat("API","!token-mod --ids -NiyJkQufZE-vGhsfxOq --set layer|gmlayer"); } } function Fuel(toggle){ if(toggle == "on"){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|objects"); sendChat("API","!token-mod --ids -NiyJkQo-VTBDocqDzxv --set layer|objects"); // sendChat("API","!roll20AM --audio,play|Beeping"); } if(toggle == "off"){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|gmlayer"); sendChat("API","!token-mod --ids -NiyJkQo-VTBDocqDzxv --set layer|gmlayer"); } } function Antenna(toggle){ if(toggle == "on"){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|objects"); sendChat("API","!token-mod --ids -NiyJkUcXQcOMyZ5cZms --set layer|objects"); sendChat("API","!roll20AM --audio,play|Beeping"); } if(toggle == "off"){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|gmlayer"); sendChat("API","!token-mod --ids -NiyJkUcXQcOMyZ5cZms --set layer|gmlayer"); } } function Clear(toggle){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|gmlayer"); } on("chat:message",function(msg){ if(msg.type=="api" && msg.content.indexOf("!Caution")==0){ var args = msg.content.split(/\s+/); var cautionType = args[1]; var toggle = args[2]; switch(cautionType){ case "ObsDet": ObsDet(toggle); break; case "Scan": Scan(toggle); break; case "IFF": IFF(toggle); break; case "SenserLock": SenserLock(toggle); break; case "Fuel": Fuel(toggle); break; case "Antenna": Antenna(toggle); break; case "Clear": Clear(toggle); break; } } }); function ObsDet(toggle){ if(toggle == "on"){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|objects"); sendChat("API","!token-mod --ids -NiyJkQufZE-vGhsfxOq --set layer|objects"); sendChat("API","!roll20AM --audio,play|Beeping"); } if(toggle == "off"){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|gmlayer"); sendChat("API","!token-mod --ids -NiyJkQufZE-vGhsfxOq --set layer|gmlayer"); } } function Scan(toggle){ if(toggle == "on"){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|objects"); sendChat("API","!token-mod --ids -NiyJkTaqbIjgPdKGBQE --set layer|objects"); sendChat("API","!roll20AM --audio,play|Beeping"); } if(toggle == "off"){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|gmlayer"); sendChat("API","!token-mod --ids -NiyJkTaqbIjgPdKGBQE --set layer|gmlayer"); } } function IFF(toggle){ if(toggle == "on"){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|objects"); sendChat("API","!token-mod --ids -NiyJkTNTvmWlTMtFj2H --set layer|objects"); sendChat("API","!roll20AM --audio,play|Beeping"); } if(toggle == "off"){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|gmlayer"); sendChat("API","!token-mod --ids -NiyJkTNTvmWlTMtFj2H --set layer|gmlayer"); } } function SenserLock(toggle){ if(toggle == "on"){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|objects"); sendChat("API","!token-mod --ids -NiyJkUYTs5qJZkYAVM_ --set layer|objects"); sendChat("API","!roll20AM --audio,play|Beeping"); } if(toggle == "off"){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|gmlayer"); sendChat("API","!token-mod --ids -NiyJkQufZE-vGhsfxOq --set layer|gmlayer"); } } function Fuel(toggle){ if(toggle == "on"){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|objects"); sendChat("API","!token-mod --ids -NiyJkQo-VTBDocqDzxv --set layer|objects"); // sendChat("API","!roll20AM --audio,play|Beeping"); } if(toggle == "off"){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|gmlayer"); sendChat("API","!token-mod --ids -NiyJkQo-VTBDocqDzxv --set layer|gmlayer"); } } function Antenna(toggle){ if(toggle == "on"){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|objects"); sendChat("API","!token-mod --ids -NiyJkUcXQcOMyZ5cZms --set layer|objects"); sendChat("API","!roll20AM --audio,play|Beeping"); } if(toggle == "off"){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|gmlayer"); sendChat("API","!token-mod --ids -NiyJkUcXQcOMyZ5cZms --set layer|gmlayer"); } } function Clear(toggle){ sendChat("API","!token-mod --ids -NiUuLERR0k00TKbcBUo --set layer|gmlayer"); }