Hey @hank,
Please excuse my late reply.
We took a closer look at this together with @leolabs.
The issue was that when sending 1 / 0 from a Script button, JavaScript always serializes numbers as floats, and AbletonOSC differentiates between floats and integers.
In short, the fix is simply to use true / false instead of 1 / 0. AbletonOSC will interpret those correctly.
Here’s a single-button toggle you can try:
Arm & Disarm Toggle.json (1.0 KB)
I’ll share the setup below in case anyone else finds it useful:
Canvas Button → Type: Script
Label
${shared("recArm_27_30", false) ? "ARMED" : "DISARMED"}
Script On Press
const target = "127.0.0.1:11000/live/track/set/arm";
const tracks = [27, 28, 29, 30];
// Read stored state (default = false)
const armed = !!shared("recArm_27_30", false);
const next = !armed;
// Store new state
setShared("recArm_27_30", next);
// Send true/false instead of 1/0
for (const t of tracks) {
sendOsc(target, t, next);
}
Background Color set to Dynamic
${shared("recArm_27_30", false) ? "red-600" : "red-950"}
Adjust colors to taste.
This will toggle all four tracks between armed and disarmed with a single button.
Regarding targeting tracks by name: in AbletonOSC, /live/track/set/arm takes a track_id (index), not a name. The API can read a track’s name (e.g. /live/track/get/name <track_id>), but there isn’t a built-in “set arm by name” address.
Because of that, it isn’t currently possible to reliably resolve name → index inside a Canvas script.
For a solid workflow, the best option is to keep those “record” tracks in a fixed position in your template (so their indices don’t change), and avoid reordering them once your Canvas is mapped. If you do need alternate layouts, you can also keep a second button preset for a different index range (e.g. tracks 31–34) for sessions that require a different track order.
Hope that helps!