I was a complete beginner 2yrs ago and learned by looking at other people's macros. Following the logic from start to finish and searching the forum when you get stuck is much better than watching someone make one specific macro that isn't necessarily related to the task you're interested in.
With respect to AppleScript, one thing that is really helpful is to save snippets for reuse. I use Alfred for this, but you could just keep a text document for useful script fragments. The most useful one for Logic is the tell block, within which you'll place your instructions:
activate application "Logic Pro X"
tell application "System Events"
tell process "Logic Pro"
set tracks_window to title of first window whose title contains "- Tracks"
<INSTRUCTIONS HERE>
end tell
end tell
Oh Wow this is so beautiful..
How did you defined (or noticed) the pop up windows number in MIDI transform window or Functions button as group 1 of group 1 of group 4?
It might be distracting questions but I'm just a guy making music with computer and have no idea which keywords to searching google or the forum.
(Besides that I'm not native English speaker so I spent lots of time to understand the programmers' term XD.)
Lots of help saying this lots, lots of time Thanks, you're my savier.
And I'm going to dig script editor right now.
The front window is always window 1. I tried to specify the window containing "- Transform" but this didn't work (maybe because it's a floating window). It doesn't really matter though, as you'll only be using this when Transform is at the front.
Get the trial of UI Browser. It's being discontinued soon, so it might end up open source (free). If you don't want to wait, there are other ways to get a UI Element path for free, like THIS.
Unless I've missed something else, the V2 version you posted has one Logic Key Command changed, which is an expected part of the setup for each user. The mistake I made was neglecting to tag that one green, and I've corrected it in the original macro above.
Speaking of, we're a few days away from end of life:
UI Browser End of Life: UI Browser will reach its end of life and be retired on October 17, 2022. The current release of UI Browser, version 3.0.2, will not be updated. On the end-of-life retirement date, the PFiddlesoft website will be closed. Thereafter, it will no longer be possible to download or purchase UI Browser, and product support will no longer be available.
I've got a couple, similar to your Track Bounce and Marker Bounce, that I might clean up and post. The Track Bounce automatically stops when the track's name is either Output 1-2 or Stereo Out. I'm sure my use cases are similar to yours as well β all-tracks bounce = produce multitracks (in my case with the song title prepended and the track named for the instrument/stem), and marker-delimited bounces = alt mixes. I also have one to create the alt mixes and so-named markers, to be used with the marker-bounce routine.
You could always create one temporarily... I really like it as a solution, as mine relied on there not being any duplicate track names, which is sh*te. Why didn't I think of creating an Output Track?!
Annoyingly, you can rename the output channel by right-clicking, but not via key command or menu item.
Track rename works, but not channel rename in the Mixer pane/window.
Side-note: A quirk of Logic is that it doesn't update the availability of menu items until the menubar is clicked, but double-dippin' seems to do the trick. This is good because using menu items means other users' personalised key commands become less of an issue. Longer-winded, but probably worth it.
And here's this, if it's of interest. It's a demo of my macro to create Alt mixes within the same Project alternative, all the same length (as many publishers require), and delimited by markers named for each typical alt mix. It works hand in hand with my Bounce Alts macro, which uses the markers to name the bounces.
@noisneil, I'm sure you can help with this: I've had a macro running just fine to Normalize Gain to -12.0 (Individual Region + Peak) by tabbing into the Normalize Gain window. But it would be a lot cleaner to use AppleScript to directly access the GUI objects.
I've got this, and the two pop-ups work beautifully - but not the slider, which I want to set to -12.0:
activate application "Logic Pro X"
tell application "System Events"
tell process "Logic Pro"
tell pop up button 1 of window "Normalize Gain"
click
click menu item "Individual Regions" of menu 1
end tell
tell pop up button 2 of window "Normalize Gain"
click
click menu item "Peak" of menu 1
end tell
tell slider 1 of group 1 of window "Normalize Gain"
set contents of slider 1 of group 1 of window "Normalize Gain" to 12.0
end tell
end tell
end tell
I've found a lot of people wrestling with the same thing in fora across the land (lol) but not a solution that works here. Clues?
Window Discovery Tool gave me this for the Normalize Gain window:
pop up button 1
pop up button 2
slider 1 of group 1 of window "Normalize Gain" of application process "Logic Pro X" of application "System Events",
button "Cancel" of window "Normalize Gain" of application process "Logic Pro X" of application "System Events",
button "Apply" of window "Normalize Gain" of application process "Logic Pro X" of application "System Events",
{group 1 of window "Normalize Gain" of application process "Logic Pro X" of application "System Events",
slider 1 of group 1 of window "Normalize Gain" of application process "Logic Pro X" of application "System Events",
static text "1 Region selected" of window "Normalize Gain" of application process "Logic Pro X" of application "System Events",
static text "Target Level:" of window "Normalize Gain" of application process "Logic Pro X" of application "System Events",
button "Cancel" of window "Normalize Gain" of application process "Logic Pro X" of application "System Events",
button "Apply" of window "Normalize Gain" of application process "Logic Pro X" of application "System Events",
static text "Algorithm:" of window "Normalize Gain" of application process "Logic Pro X" of application "System Events",
pop up button 1 of window "Normalize Gain" of application process "Logic Pro X" of application "System Events",
pop up button 2 of window "Normalize Gain" of application process "Logic Pro X" of application "System Events",
static text "Affect:" of window "Normalize Gain" of application process "Logic Pro X" of application "System Events",
static text "db" of window "Normalize Gain" of application process "Logic Pro X" of application "System Events",
static text "Normalize Gain" of window "Normalize Gain" of application process "Logic Pro X" of application "System Events"}
Sorry! Should've given a bit of preamble β it's a demo of my macro to create Alt versions within the same Project alternative, all the same length, and delimited by markers named for each typical alt mix. It works hand in hand with my Bounce Alts macro, which uses those same markers to name the bounces.