Setting a track's output in the Logic Pro's Mixer. - Could not click popup menu item.
Summary
Hi Christian. In an attempt to set the output of a logic track in the mixer, SoundFlow finds the Menu Item information but is unable to instantiate the audio track's output path.
*This is in reference to @Alex_Oldroyd8's thread Fetching path from popup menu #post-3 *
Steps to Reproduce:
Create a script with the following function;
function setOutputPath({ menuPath }) {
//Logic Pro
const logic = sf.ui.app("com.apple.logic10");
//Activate Logic's main window
logic.appActivateMainWindow();
//Mixer Groups
const mixerGroup = sf.ui.app("com.apple.logic10").mainWindow.groups.whoseDescription.is("Mixer").first;
//Mixer Layout
const mixerLayout = mixerGroup.children.whoseRole.is("AXLayoutArea").whoseDescription.is("Mixer").first;
//First Selected Track
const firstSelectedTrack = mixerLayout.getElements('AXSelectedChildren').first;
//First Selected Track's Buttons
const channelStripButtons = firstSelectedTrack.buttons;
//Get Channel Strip Button Info
const channelStripButtonInfo = channelStripButtons.map(btn => ({
title: btn.getString("AXDescription"),
buttonType: btn.getString("AXRoleDescription"),
frame: {
h: btn.frame.h,
w: btn.frame.w,
},
element: btn,
}));
//Output Button (First Button that matches {height: 18 width: 58})
const outputButton = channelStripButtonInfo.find(btn => btn.frame.h === 18 && btn.frame.w === 58).element
//Log Matching Popup Menu Item from menuPath arg
log(outputButton.popupMenuFetchAllItems().menuItems.filter(mi => JSON.stringify(mi.path) === JSON.stringify(menuPath))[0]);
//Close Popup
logic.appActivateMainWindow();
//Wait for demonstration purposes only.
sf.wait()
//Attempt to set the tracks output
outputButton.popupMenuSelect({
menuPath,
});
}
Set up a Logic session as follows;
- Create a new blank Logic Session
- Select Menu Item "View" => "Show Mixer"
- Create an audio track "Audio 1"
- Select the "Audio 1" track in the Mixer
Test 1
Call the function with the following call;
setOutputPath({
menuPath: ["Bus", "Bus 1"],
});
This attempt is successful at finding the filtered menu item and setting the output
With the "Audio 1" track selected in the mixer;
- Select Menu Item "Track" => "Create Track Stack…"
- Select the "Summing Stack" Radio button.
- Click the "Create" button.
- Re-select the "Audio 1" track only.
- Set Output of "Audio 1" to "No Output".
Test 2
Call the function with the following call;
setOutputPath({
menuPath: ["Bus", "Aux 1", "Bus 1 → Aux 1"],
});
This attempt is successful at finding the filtered menu item but failed to set the output.
This is what the log report looks like;
07.08.2022 19:40:54.76 <info> [Backend]: #Key: ctrl+x (7) -> Select Track Output [cl6hlqrc90002mb10qs9ayeeh]
>> Command: Select Track Output [user:ck0h82cwn000daz10hbpeyuoy:cl6h8mi420001mb10r4rwkz54]
07.08.2022 19:40:54.76 <info> [Backend]: Checking for running apps with bundle 'com.apple.logic10'
NSArray.ArrayFromHandle count = 1
07.08.2022 19:40:54.84 <info> [Backend]: Mouse current pos is: (445.50390625, 1394.2734375)
Clicking with mouse here: (70, 28)
07.08.2022 19:40:54.85 <info> [Backend]: Moving mouse back to: (445.50390625, 1394.2734375)
07.08.2022 19:40:54.86 <info> [Backend]: Position is now: (445.50390625, 1394.2734375)
07.08.2022 19:40:54.87 <info> [Backend]: Command accepted for app: com.apple.logic10
07.08.2022 19:40:54.94 <info> [Backend]: Mouse current pos is: (445.50390625, 1394.2734375)
Clicking with mouse here: (399, 1007)
07.08.2022 19:40:54.95 <info> [Backend]: Moving back...
07.08.2022 19:40:54.95 <info> [Backend]: Position is now: (445.50390625, 1394.2734375)
07.08.2022 19:40:55.03 <info> [Backend]: [LOG] {
"Path": [
"Bus",
"Aux 1",
"Bus 1 → Aux 1"
],
"Names": [
"Bus",
"Aux 1",
"Bus 1 → Aux 1"
],
"Delimiter": " -> ",
"Element": "{\"title\":\"Bus 1 → Aux 1\",\"role\":\"AXMenuItem\",\"fullRole\":\"AXMenuItem\"}",
"path": [
"Bus",
"Aux 1",
"Bus 1 → Aux 1"
]
}
07.08.2022 19:40:55.04 <info> [Backend]: Checking for running apps with bundle 'com.apple.logic10'
NSArray.ArrayFromHandle count = 1
07.08.2022 19:40:55.20 <info> [Backend]: Mouse current pos is: (445.50390625, 1394.2734375)
Clicking with mouse here: (70, 28)
Moving mouse back to: (445.50390625, 1394.2734375)
Position is now: (445.50390625, 1394.2734375)
07.08.2022 19:40:56.21 <info> [Backend]: Mouse current pos is: (445.50390625, 1394.2734375)
Clicking with mouse here: (399, 1007)
07.08.2022 19:40:56.21 <info> [Backend]: Moving back...
07.08.2022 19:40:56.22 <info> [Backend]: Position is now: (445.50390625, 1394.2734375)
07.08.2022 19:40:56.25 <info> [Backend]: Logging error in action (01) ClickPopupMenuAction: Could not find menu item with name: Bus -> Aux 1 -> Bus 1 → Aux 1
07.08.2022 19:40:56.36 <info> [Backend]: Checking for running apps with bundle 'com.apple.logic10'
07.08.2022 19:40:56.36 <info> [Backend]: NSArray.ArrayFromHandle count = 1
07.08.2022 19:40:56.46 <info> [Backend]: Mouse current pos is: (445.50390625, 1394.2734375)
Clicking with mouse here: (70, 28)
07.08.2022 19:40:56.47 <info> [Backend]: Moving mouse back to: (445.50390625, 1394.2734375)
07.08.2022 19:40:56.47 <info> [Backend]: Position is now: (445.50390625, 1394.2734375)
07.08.2022 19:40:56.49 <info> [Backend]: Logging error in action (01) PopupMenuSelectAction: Could not click popup menu item
07.08.2022 19:40:56.49 <info> [Backend]: !! Command Error: Select Track Output [user:ck0h82cwn000daz10hbpeyuoy:cl6h8mi420001mb10r4rwkz54]:
Could not click popup menu item (Select Track Output: Line 44)
Could not find menu item with name: Bus -> Aux 1 -> Bus 1 → Aux 1
<< Command: Select Track Output [user:ck0h82cwn000daz10hbpeyuoy:cl6h8mi420001mb10r4rwkz54]
Expected Results
The "Audio 1" tracks output should be set to the following path;
[
"Bus",
"Aux 1",
"Bus 1 → Aux 1"
],
As seen in the following screen-shot the path exists
Actual results
The attempt is successful at finding the filtered menu item, but failed to set the output (ie "Could not click popup menu item").
Let me know if you have any further questions. :-)
Rock on!
Linked from:
- SSoundFlow Bot @soundflowbot
Thanks for contacting SoundFlow support.
Please note, that the best way to get help with a script, macro or other content installed from the Store or content that you've made yourself, is to select the script/macro, then click the red Need help button, and then click "Get help with this script or macro".
By using this method, we will get access to more information and so should be able to help you quicker.
You can read more about how this works here: bit.ly/sfscripthelpIf you're seeing an error that isn't related to scripts or macros, and you think this is a bug in SoundFlow, please file a Help/Issue bug report.
You can see how to do this by going to bit.ly/sfhelpissue
In reply toKitch⬆:Christian Scheuer @chrscheuer2022-08-10 22:37:38.129ZNice writeup. I don't believe we support Logic popup menus, last time I checked they had a bunch of issues, so this is likely something that will need more work as part of a potential future official Logic support update.
Kitch Membery @Kitch2022-08-10 22:51:50.054ZThanks @chrscheuer. :-)
- SIn reply toKitch⬆:SoundFlow Bot @soundflowbot
This issue is now tracked internally by SoundFlow as SF-640