By Yujiro Yonetsu @Yujiro_Yonetsu
I want to do an action that only selects the drum track or only selects multiple tracks of bass, what is the best way to do that?
- Christian Scheuer @chrscheuer2020-10-23 15:42:44.392Z
Do you want this to happen based on the track's name or based on the track belonging to a group?
- In reply toYujiro_Yonetsu⬆:Yujiro Yonetsu @Yujiro_Yonetsu
I want to select based on the track belonging to a group.
- In reply toYujiro_Yonetsu⬆:Yujiro Yonetsu @Yujiro_Yonetsu
In other words, I want it to behave like when I click on the leftmost column of the group window.
Christian Scheuer @chrscheuer2020-10-23 16:36:36.054Z
You should be able to use something like this:
function getGroup(name) { var groupList = sf.ui.proTools.mainWindow.tables.whoseTitle.contains('Group').first; return groupList.childrenByRole("AXRow").allItems.map(function (r) { return { row: r, selectBtn: r.childrenByRole("AXCell").first.children.first, name: r.childrenByRole("AXCell").allItems[1].children.first.title.value.match(/^.+ - ([^(]+)/)[1].replace(/ $/, ''), }; }).filter(function (r) { return r.name == name })[0]; } function selectGroup(name) { var grp = getGroup(name); if (!grp) { log('Error', 'Group "' + name + '" not found'); throw 0; } grp.selectBtn.mouseClickElement({}); } selectGroup("Group 1");
Christian Scheuer @chrscheuer2020-10-23 16:36:44.652Z
See here for more context:
- In reply toYujiro_Yonetsu⬆:Yujiro Yonetsu @Yujiro_Yonetsu
Awesome!
Thank you so much!