Logic Pro - Macro Megathread (2022)

Thanks!

This macro also has your image file path!
I'll keep update which has same conditions.

Oops again. I've updated it to include the images.

Hi there!

Really enjoying this thread :slight_smile:

I'm very new (as of today) with KM and I'm trying to create my very first macro but have no idea how.
I would like a macro that will bounce regions in place.

After selecting a region KM should perform the following:

  • pop up asking how many tracks/regions should be bounced in place
  • "Set Locators/Loop by Regions/Events/Marquee and Enable Cycle/Loop” by pressing 'U'
  • hit keystroke 'ctrl+B'
    in popup window:
  • Destination: 'new track'
  • Source: 'Mute'
  • 'include instrument Multi-Outputs
  • 'include Audio Tail File
  • 'include Audio Tail in Region
  • Press 'OK'

I know what I want to achieve but have no idea how to set this up...

Hi and welcome to the forum! I'm glad to hear you're getting some use out of these macros. :blush:

Here's a macro that does what you asked for:

Bounce In Place.kmmacros (25 KB)

Macro screenshot

1 Like

I'm trying to script my own custom macros based on your scripts.

How do you deal with the submenu kinda windows & menus?
For example, MIDI transform window


In this case, I want to confirm if the mode menu is set to Apply operations to selected events

or

submenu inside the arrange window

image
in this case, I want to trigger Functions menu.

Since my work environment changes often (using ext monitor / just using laptop itself) I'm trying to avoid use mouse position commands but there are so many variables when just using found image commands.

In case of Bounce Tracks that you've shared

I can see you used Apple script when dealing checkboxes.
Is Applescript only way to deal with these kind of isssues?

Hope you have tips and easier way to get the answer.
Thanks again

I'd do this:

activate application "Logic Pro X"
tell application "System Events"
	tell process "Logic Pro"
		
		if value of pop up button 1 of window 1 is "Apply operations to selected events" then
		else
			click pop up button 1 of window 1
			keystroke "a"
			key code 36
		end if

	end tell
end tell

Here's a script for that:

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"
		
	click menu button "Functions"  of group 1 of group 1 of group 4 of window tracks_window
		
	end tell
end tell

It's certainly the best one I know of. KM doesn't have any radio button/check box actions, and using found images can get cumbersome. AS allows you to easily test the condition of the button/box and click if necessary, in one line.

1 Like

Wow Thanks again @noisneil
I should take a shot digging AS.
Never learned scripting in a classic way.

1 Like

Awesome! Thank you so much!

1 Like

And by the way this request would be annoying but could you make a video capture making KM macros for Logic? (tutorial vids would be appreciated so much.)
It would be so helpful seeing someone skilled user scripting KM. I think I'm get lost so often during making one short macro.

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
2 Likes

@fairchilde17, I've edited this to make sure nothing happens if it's already selected.

2 Likes

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.

1 Like

Hi there again :slight_smile:

I was trying out the 'bounce all markers' macro but somehow it is getting stuck..

What I would like it to do is the following:

  • Make sure cursor is at 1st marker
  • pop up: ‘how many markers?’
  • rename marker hotkey
  • copy text
  • ‘Set Locators by Next Maker and Enable Cycle’ hotkey
  • cmd+B
  • set checkbox to ‘mp3’
  • Create folder with Project Name
  • Bounce name = paste text from 'rename marker' step
  • press OK
  • repeat

Again I would really like to learn how to make this myself, but for now, I'm just trying to make sense of it all :slight_smile:

Hiya! Yeah that's an old one and needed tweaking. I've updated it above. :+1:t3:

1 Like

Just to clarify for anyone else reading 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.

@ween This is the new version of the thread. Please see the updated version of the Vocalign Auto macro above. :+1:t3:

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.

So much good stuff here, @noisneil! Thank you!

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.

2 Likes

Does this rely on there being a track for the output channel? (i.e. Show Output Track)