From f0443be269ce62f7e029ca6418dade383b6ba9e4 Mon Sep 17 00:00:00 2001 From: Ziforge Date: Wed, 9 Sep 2026 03:34:35 +0200 Subject: [PATCH] Grouping tools: honest error instead of cryptic AttributeError create_group_track / group_tracks call song.create_group_track(), which is not in the LOM in most Live versions (track grouping is GUI-only). Guard with hasattr and return a clear 'GUI-only, use Cmd+G' error; keep the real path for any version that does expose it. Co-Authored-By: Claude Opus 4.8 (1M context) --- ClaudeMCP_Remote/liveapi_tools.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/ClaudeMCP_Remote/liveapi_tools.py b/ClaudeMCP_Remote/liveapi_tools.py index 68ce73e..a4c5edf 100644 --- a/ClaudeMCP_Remote/liveapi_tools.py +++ b/ClaudeMCP_Remote/liveapi_tools.py @@ -3061,14 +3061,18 @@ def get_crossfader_position(self): # ======================================================================== def create_group_track(self, name=None): - """Create a new group track""" + """Create a group track from the selected tracks, if the LOM supports it. + + Track grouping is GUI-only in most Live versions (Cmd+G); returns an honest + error where unsupported instead of a cryptic AttributeError. + """ try: + if not hasattr(self.song, 'create_group_track'): + return {"ok": False, "error": "Track grouping is not exposed by the Live Object Model in this version (GUI-only: select tracks and press Cmd+G)."} track_index = len(self.song.tracks) self.song.create_group_track(track_index) - if name and track_index < len(self.song.tracks): self.song.tracks[track_index].name = str(name) - return { "ok": True, "message": "Group track created", @@ -3079,17 +3083,19 @@ def create_group_track(self, name=None): return {"ok": False, "error": str(e)} def group_tracks(self, start_index, end_index): - """Group tracks from start_index to end_index (inclusive)""" + """Group a contiguous range of tracks, if the LOM supports it. + + Track grouping is GUI-only in most Live versions; returns an honest error + where unsupported rather than faking success. + """ try: if start_index < 0 or start_index >= len(self.song.tracks): return {"ok": False, "error": "Invalid start index"} if end_index < start_index or end_index >= len(self.song.tracks): return {"ok": False, "error": "Invalid end index"} - - # Group the tracks + if not hasattr(self.song, 'create_group_track'): + return {"ok": False, "error": "Track grouping is not exposed by the Live Object Model in this version (GUI-only: select the tracks and press Cmd+G)."} self.song.create_group_track(end_index + 1) - - # Move tracks into the group (this is simplified - actual implementation may vary) return { "ok": True, "message": "Tracks grouped",