Brand new, non developer trying to use Bunch for MIDI #234
Unanswered
clementunes
asked this question in
Q&A
Replies: 3 comments 1 reply
-
I don't believe Audio Midi Setup is scriptable in that way, so you'd
have to rely on UI scripting. If the available inputs are variable, then
UI scripting would be very difficult (it generally relies on menu item
names to click). If the inputs are changing, even doing it with Keyboard
Maestro might be difficult. But I'm conjecturing without fully knowing
the circumstances you're trying to automate.
…On 21 Jul 2022, at 11:09, clementunes wrote:
Hello!
I am a composer and musician and not at all a developer or programmer.
I have been following Brett's work for a number of years, but never
really dove into working with his tools. I thought I would change that
by trying out Bunch.
I have no idea what I am doing, and truthfully, a lot of the
documentation goes over my head. I have been a Mac user since 1987,
but never programmed or done much with the Terminal. But I am eager to
learn and make my way through the documentation.
The first Bunch I am eager to build involves the Audio Midi setup app
in Utilities.
I would like to have a bunch that would quit all apps, startup Audio
Midi Setup, select any available MIDI Bluetooth interfaces and quit,
Then load in my music programs. I can figure out the quitting apps
part and the launching apps, but does anyone have suggestions on how
to get Audio MIDI setup to select menu items and click boxes? maybe
this needs to be done in concert with Keyboard Maestro?
Any advice it appreciated. Thanks!!! Looking forward to learning more
and getting into the CLI a bit more.
Cheers!
kc
--
Reply to this email directly or view it on GitHub:
#234
You are receiving this because you are subscribed to this thread.
Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
-
That's not scriptability on the part of Audio Midi Setup, it's just
System Events scripting that's available in any application (raising
windows and clicking menu items based on position or title). It's a very
fragile form of automation… if anything changes in menu title,
position, or available options, it will break. The shell script part is
a utility you'd have to install manually which performs clicks at a
certain pixel location.
I think that the kind of automation you see in that script would be more
easily accomplished with Keyboard Maestro, and the result would be more
maintainable (and easier to modify if it breaks). Cl9ck the bluetooth
connection menu item, then use something like KM's ability to detect
certain image patterns on the screen to find the connect buttons?
If you do get a KM macro figured out that can do it, you can easily
[trigger that from
Bunch](https://bunchapp.co/docs/integration/keyboard-maestro/)
…-Brett
On 21 Jul 2022, at 15:40, clementunes wrote:
Thanks Brett -
I did find this AppleScript over at the Apple site:
tell application "Audio MIDI Setup" to activate
tell application "System Events"
tell process "Audio MIDI Setup"
tell menu item 2 of menu 1 of menu bar item "Window" of menu
bar 1
if name is "Show MIDI Window" then click
end tell
tell window "MIDI Studio"
set position to {0, 22}
perform action "AXRaise"
end tell
do shell script "/usr/local/bin/cliclick 235 180"
end tell
end tell
So I know there are some scriptable things within MIDI Setup. Not
knowing AppleScript, I did try and play with the code and see if I
could get it to select a different menu and different item from the
menu without luck. Not sure what the shell script is trying to do.
My thinking is, if I could get AppleScript to open the Midi Studio
menu and select the Open Bluetooth Config menu (which is what this
script seems to do, just in a different menu) maybe I could get KM to
do it's mouse click thing on the Connect button? And then close out
the app?


The menu item is always the same, and I know I can assign a keyboard
shortcut to that menu, maybe that is easier? Open the app, either
Bunch or KM type the key command to open Midi Studio Config, KM click
on connect? Close app.
Thanks for your help. I always appreciate your appearances on MPU and
other podcasts.
--
Reply to this email directly or view it on GitHub:
#234 (comment)
You are receiving this because you commented.
Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
I am a composer and musician and not at all a developer or programmer. I have been following Brett's work for a number of years, but never really dove into working with his tools. I thought I would change that by trying out Bunch.
I have no idea what I am doing, and truthfully, a lot of the documentation goes over my head. I have been a Mac user since 1987, but never programmed or done much with the Terminal. But I am eager to learn and make my way through the documentation.
The first Bunch I am eager to build involves the Audio Midi setup app in Utilities.
I would like to have a bunch that would quit all apps, startup Audio Midi Setup, select any available MIDI Bluetooth interfaces and quit, Then load in my music programs. I can figure out the quitting apps part and the launching apps, but does anyone have suggestions on how to get Audio MIDI setup to select menu items and click boxes? maybe this needs to be done in concert with Keyboard Maestro?
Any advice it appreciated. Thanks!!! Looking forward to learning more and getting into the CLI a bit more.
Cheers!
kc
Beta Was this translation helpful? Give feedback.
All reactions