I swap between Cubase and Reason a fair bit, I think I was in Cubase at the time but the more I’m using it the more I notice it whenever it’s more than one menu deep. Confirmed by UIBrowser which I’m is a pretty cool app albeit unstable.
I think I can see where to add the additional "" but I'm not all that game to try. I guess I could always copy it first couldn't; i.
I've love if I could could 'recording' the different mouse clicks and then have the resulting code already all stitched together. would that be an easy change or a big one?
Hello @apiary👋
While the recording would be a nice feature to implement Neil should have to write a lot of code that needs to store everything in a kind of endless loop that you want to save and then the results would have to be generated into one large piece of AppleScript code. This is a lot of work though. And since I have some Scripts that generate AppleScript code written about 1-2 years ago by my self I already know what I am talking about.
So consider this request as a big change to the Macro.
Greetings from Germany
Tobias
I spent quite a long time trying to make this work today and failed. Maybe someone with a better handle on complex parsing can have a go...?
I also failed at my attempt. I can’t figure out the logic when it goes deeper than one level, it appears to follow a pattern but when I add the quotes accordingly it’s all cactus. Thanks for your efforts so far Noisneil, I have also found there are actual apps out there that claim to export the whole menu tree as tell block etc and also don’t work deeper than one level. Only one that works for me is UIBrowser which although excellent its very unstable and I also don’t understand parts of it yet.
I went for a different approach for this particular task I was doing by utilising the help menu. Some apps, have every command on offer, exactly as spelt, in their help menu which of course is searchable and in this case, I know what all the commands are, so the steps are:
- Command+Shift+/ to engage the help search bar, then paste tye command exactly as spelled and wrapped in “quotes”. This is important, as they keep the results unique. Then the down arrow once, and then return key all with some small delays in between. There might be a couple that don’t work but given how easy that was to do for the whole lot, I’ll accept that over menu x of menu item y of menu blah blah. The commands names are already unique, so I don’t see busy work in getting to them through the menu tree all that beneficial.
Oh only because the end result isn’t related to KM. Or at least, I didn’t plan on it being that way. I was making a kind of companion/panel app, which basically does what the pallets do for us only for people who don’t have KM.
You know what its a good point though, for the purpose of generating the tell blocks and the like, I suppose I could. Like I was saying earlier, because I’ve already got the end commands in a list, I was looking for a solution that didn’t involving me clicking it out really.
Sure no worries. It seems I should be able to do it with the macro he’s made anyway.
another good app to checkout is the accessibility inspector which comes with Xcode. (see File, open developer tool). It's reliable as anything and really easy to use. it can follow the mouse or y0ou can toggle the record state with option space.
Note the hierarchy view, element class, the name and poosition of everything. really good.
It would be great if we could use this to spit out the element tree instead, as it would mean not needing to actually click the element, as you do with my method.
Not wanting to be beaten, I had another think and, instead of restructuring the script as a whole, I added a quote check at the end. See if this works for you:
ah, that's very clever. so you left it 'as is' and then tact on some something after it has finished to reformat it o to speak? I'll have a look in a minute.
Re: Accessibility inspector, I know what you mean but yours (apart from this glitch) is much less scary, the 'AI' (conincidence?) turns the screen green and has gets a bit glitchy as do all UI recorders sometimes. yours is a mouse over and a nice sharp press and whack, you've got it. I do wonder if it would be slightly more practical to choose the command option (1 of 4) you want before capturing the UI but I can see cases for both ways really.
Can you clarify what you're referring to?
works a treat noisneil:
activate application "Cubase 14"
tell application "System Events"
tell process "Cubase 14"
click menu item "MIDI Device Manager..." of menu "More Options" of menu item "More Options" of menu "Studio" of menu bar item "Studio" of menu bar 1
end tell
end tell
which means you've probably just created the most helpful thing to ever exist on an apple machine - hows about a round of applause ladies and gentlemen.
I have another, quite difficult challenge for you if you're interested?
Dare I ask?
Im the proud owner one ‘MP MIDI’, 32 knob controller than is also a touch screen. Its a wicket but of gear, I have mine mounted on a monitor arm with quick release:
There are 32 (real physical knobs) around the edges of the screen which start at CC0, bottom left corner and ascend in a clockwise fashion, Mapping this unit is advertised as ‘automatic’ however from my experience its anything but this. To be fair to them, I’ve seen much worse and they’re really helpful and friendly developers but mapping knobs one by one to something sensible, cooling, labelling, times by how many plugins you have and how often you change your mind. You can imagine. They do have a somewhat automated process which is for you to pick the controls with mouse in the clockwise order of the knobs and then you hit go and that part is done. Still can take a long time, I’ve shown massive here which is a relatively simple plugin compared to many others. I can easily obtain all controllable features of any plugin and read/display it in an ordered list but this has no correlation to the position of a parameter in an X,Y sense. Ie to me it's most logical to map knobs to their closest software counterpart.
The ideas I’ve investigated are:
1: Accessibility Assistant
move very accurately with command like controls the mouse around in a clockwise fashion starting at the dges and going inwards, while recording or utilizing some sort of accessibility, voice over, etc to read out/document what those UI elements are. I got a small cat with this before raising that this is not really any good either, its better than nothing but the closest control to a button doesn’t; mean its a baton you need to use very often and tiy can end up with dumb results,
2: Template parameters
I thought I could come up with some general rules like, eq’s parameters on top, gain, or volume like parameters on the bottom, modulation sources on the left and right maybe, then some sort of tool scans the unit for parameters names and just does its best.
3: ultimately you’d want to know before you start what controls you’re likely to use the most which you probable don;’t know and haven;t thought about until now. I wondered if it would be possible to put some kind of watcher on a plugin, or all plugins, forget about it for a fortnight, then you could have a look of a heat map of sorts, see what you use the most and assign it or even better, have the Mac do it for you.
Any ideas? The mapping on this controller isn’t too bad but this happens all the time and I thought if I could come up with some thing like tis it would be good for lot of other applications.
That thing is awesome, I have never seen that before, thanks for sharing. I'd love to hear your overall take on it.
Kind of impossible for me to really grasp these challenges without actually having one of those controllers. I think your best bet is to figure out what you want to try and start a fresh thread if you need specific help with the implementation with KM.
The heatmap is probably doable in theory but would be a lot of work when I suspect that in reality you'll know what you need mapped without it.
ok. agreed. im not sure if KM is even the answer just yet but thought id ask as you seem very knowledgable.