A technical support community for Apple Logic Pro users.

 
speakerfood
Topic Author
Posts: 111
Joined: Sun Mar 21, 2010 2:48 pm
Location: Netherlands
Contact:

Re: Change Region Gain With Key Commands

Sat Nov 03, 2018 12:07 am

Should be possible, I will post an update asap
 
speakerfood
Topic Author
Posts: 111
Joined: Sun Mar 21, 2010 2:48 pm
Location: Netherlands
Contact:

Re: Change Region Gain With Key Commands

Mon Nov 05, 2018 3:57 am

This script also works with the non-floating movie window.

tell application "Logic Pro X"
tell application "System Events"
tell process "Logic Pro X"
set tracks_window to title of first window whose title contains "- Tracks"
if (description of group 1 of window tracks_window = "Control Bar") then
set group_nr to 2
else
set group_nr to 1
end if
if (value of static text 1 of group 1 of list 1 of group group_nr of window tracks_window is "Movie") then
set sub_group_nr to 2
else
set sub_group_nr to 1
end if
tell row 8 of outline 1 of scroll area 1 of group sub_group_nr of list 1 of group group_nr of window tracks_window
set x to (get value of slider 1)
set value of slider 1 to (x + 10)
end tell
end tell
end tell
end tell

In the attachment are my Keyboard Maestro macro's.
Attachments
Logic Pro X Clip Gain Macros.kmmacros.zip
(1.65 KiB) Downloaded 357 times
 
User avatar
anp27
Posts: 1728
Joined: Thu Feb 09, 2012 1:25 pm
Location: Brooklyn, New York

Re: Change Region Gain With Key Commands

Mon Nov 05, 2018 5:47 pm

speakerfood wrote:
This script also works with the non-floating movie window.

This script works correctly for me, THANK YOU SO MUCH!
Mac mini (late 2012 Server) 2.3 Ghz i7, 16GB RAM Macbook Pro 15" (early 2011) 2.3 Ghz i7~2TB Samsung 860 QVO~16GB Ram~macOS Catalina 10.15.7~Logic Pro 10.6.1~Universal Audio Apollo Twin Duo Thunderbolt MKII~KORG microKEY2 61
 
User avatar
tenorman
Posts: 18
Joined: Wed Feb 21, 2007 7:30 am
Location: Oshkosh, WI

Re: Change Region Gain With Key Commands

Mon Feb 04, 2019 1:06 pm

What would the AppleScript be if I wanted to change the Fader Type in the Inspector window? I'm using BetterTouchTool to trigger the script.

Thanks!
Mac Pro 2x 3.46 GHz 6-Core Intel Xeon
OS 10.13.6 64 GB ram
Logic Pro X 10.4.8
MOTU 828es, Focusrite Liquid 56
 
User avatar
anp27
Posts: 1728
Joined: Thu Feb 09, 2012 1:25 pm
Location: Brooklyn, New York

Re: Change Region Gain With Key Commands

Mon Feb 04, 2019 4:37 pm

tenorman wrote:
What would the AppleScript be if I wanted to change the Fader Type in the Inspector window?

Fader Type in the Inspector Window? I'm not sure what you mean?
Mac mini (late 2012 Server) 2.3 Ghz i7, 16GB RAM Macbook Pro 15" (early 2011) 2.3 Ghz i7~2TB Samsung 860 QVO~16GB Ram~macOS Catalina 10.15.7~Logic Pro 10.6.1~Universal Audio Apollo Twin Duo Thunderbolt MKII~KORG microKEY2 61
 
User avatar
tenorman
Posts: 18
Joined: Wed Feb 21, 2007 7:30 am
Location: Oshkosh, WI

Re: Change Region Gain With Key Commands

Tue Feb 05, 2019 8:33 am

My apologies for the typo. I meant the Fade Out Type in the Inspector window. There are 4 values: Out, X, EqP, and X S.

The below AppleScript was posted earlier to change the Region Gain (and works perfectly). Can this be modified to change the Fader Out Type?

Thanks for the help!

tell application "System Events"
tell process "Logic Pro X"
tell row 8 of outline 1 of scroll area 1 of group 1 of list 1 of group 2 of (first window whose name contains "- Tracks")
set x to (get value of slider 1)
set value of slider 1 to (x + 30)
end tell
end tell
end tell
Mac Pro 2x 3.46 GHz 6-Core Intel Xeon
OS 10.13.6 64 GB ram
Logic Pro X 10.4.8
MOTU 828es, Focusrite Liquid 56
 
User avatar
morganmd7
Posts: 58
Joined: Thu Jul 29, 2010 6:37 am
Location: Scaly Mountain, NC
Contact:

Re: Change Region Gain With Key Commands

Tue Feb 05, 2019 10:18 am

@speakerfood - thanks a lot! Works like a charm.
http://www.MatthewMorgansMusic.com

Composer//Sound Designer

iMac (mid 2011) 2.7 GHz i5 - SATA SSD - 24 GB RAM - Logic 10.3.2

Logic 10.0.7, OS 10.10.1, MacBook Pro (Retina, 15-inch, Late 2013), 16 GB RAM, 2.3 GHz Intel Core i7
 
speakerfood
Topic Author
Posts: 111
Joined: Sun Mar 21, 2010 2:48 pm
Location: Netherlands
Contact:

Re: Change Region Gain With Key Commands

Tue Feb 05, 2019 12:18 pm

You can use this script. Modify it to go to an exact type, by changing the keycode 125 to match the first letter of the type. If you only use this script, you also need a script to go up in the menu (key code 126 is arrow up.

BTW, this script is an improvement to previous scripts, because it also works when a movie is present or when Control Bar is not shown.

tell application "Logic Pro X"
tell application "System Events"
tell process "Logic Pro X"
set tracks_window to title of first window whose title contains "- Tracks"
if (description of group 1 of window tracks_window = "Control Bar") then
set group_nr to 2
else
set group_nr to 1
end if
if (value of static text 1 of group 1 of list 1 of group group_nr of window tracks_window is "Movie") then
set sub_group_nr to 2
else
set sub_group_nr to 1
end if
tell pop up button 1 of row 14 of outline 1 of scroll area 1 of group sub_group_nr of list 1 of group group_nr of window tracks_window
click
delay 0.2
key code 125
key code 36
end tell
end tell
end tell
end tell

tenorman wrote:
My apologies for the typo. I meant the Fade Out Type in the Inspector window. There are 4 values: Out, X, EqP, and X S.

The below AppleScript was posted earlier to change the Region Gain (and works perfectly). Can this be modified to change the Fader Out Type?

Thanks for the help!

tell application "System Events"
tell process "Logic Pro X"
tell row 8 of outline 1 of scroll area 1 of group 1 of list 1 of group 2 of (first window whose name contains "- Tracks")
set x to (get value of slider 1)
set value of slider 1 to (x + 30)
end tell
end tell
end tell
 
User avatar
tenorman
Posts: 18
Joined: Wed Feb 21, 2007 7:30 am
Location: Oshkosh, WI

Re: Change Region Gain With Key Commands

Tue Feb 05, 2019 12:33 pm

speakerfood - thanks so much. Exactly what I was looking for and works perfectly!
Last edited by tenorman on Wed May 15, 2019 6:10 am, edited 1 time in total.
Mac Pro 2x 3.46 GHz 6-Core Intel Xeon
OS 10.13.6 64 GB ram
Logic Pro X 10.4.8
MOTU 828es, Focusrite Liquid 56
 
User avatar
fastfourier
Posts: 579
Joined: Wed Jun 22, 2011 12:00 pm
Location: The T-Dot

Re: Change Region Gain With Key Commands

Tue May 14, 2019 12:49 pm

Hi speakerfood! This is great work, thank you! How did you figure out the applescript "path"? The Script Editor dictionary isn't telling me much!
Logic 10.5.0 / MBP Mid 2015 / OS 10.14.6
 
speakerfood
Topic Author
Posts: 111
Joined: Sun Mar 21, 2010 2:48 pm
Location: Netherlands
Contact:

Re: Change Region Gain With Key Commands

Thu May 16, 2019 11:48 pm

I use a GUI inspector but it's a lot of trial and error because of insufficient naming of GUI elements.
 
User avatar
Roger
Posts: 21
Joined: Mon Oct 09, 2006 2:56 pm

Re: Change Region Gain With Key Commands

Fri Jun 28, 2019 8:54 am

Hi guys..

So far I learned quite a lot from those scripts (thnx speakerfood & scripters..) ..with help of Accessibility Inspector.
I am trying to figure out how to use decimal values.
I can change values (gain - row 9) with 'increment' and 'decrement' actions, but it moves by 10 (or 1.0)
Moving by 1 (or 0.1) would be appropriate.

with this code, the value moves by 0.1, but I think there is a lot more lag:
tell row 9 of outline 1 of scroll area 1 of group sub_group_nr of list 1 of group group_nr of window tracks_window
set x to (get value of slider 1)
set value of slider 1 to (x + 1)


Maybe someone can help me with the solution for 'increment' and 'decrement' actions to move by 0.1?

the script:
tell application "Logic Pro X"
tell application "System Events"
tell process "Logic Pro X"
set tracks_window to title of first window whose title contains "- Tracks"
if (description of group 1 of window tracks_window = "Control Bar") then
set group_nr to 2
else
set group_nr to 1
end if
if (value of static text 1 of group 1 of list 1 of group group_nr of window tracks_window is "Movie") then
set sub_group_nr to 2
else
set sub_group_nr to 1
end if

tell slider 1 of row 9 of outline 1 of scroll area 1 of group sub_group_nr of list 1 of group group_nr of window tracks_window

-- increment
decrement


end tell
end tell
end tell
end tell




BTW, I am using Keyboard Maestro.

Thnx,
Roger
iMac 27" late 2015 | 4.00 GHz i7 | 32GB | OS X 10.15.4 | Logic Pro X 10.4.8 | FF800 | Nova | SPL 2381 | Luna II | MC TRANSPORT | HR824 | MSP5A | MAX49 | nanoKONTROL2 | nanoPAD2 | LPD8 | LPK 25 | MX1000 | diNovo |
 
speakerfood
Topic Author
Posts: 111
Joined: Sun Mar 21, 2010 2:48 pm
Location: Netherlands
Contact:

Re: Change Region Gain With Key Commands

Tue Jul 16, 2019 2:49 am

I don't think you can change the increment or decrement value. I'm using the x+1 method, there's a tiny lag but absolutely workable.
 
User avatar
Roger
Posts: 21
Joined: Mon Oct 09, 2006 2:56 pm

Re: Change Region Gain With Key Commands

Tue Jul 16, 2019 5:18 am

@speakerfood, thnx. I thought that.
I also noticed more lag with the second script, when the project is overloaded with plugins :)
iMac 27" late 2015 | 4.00 GHz i7 | 32GB | OS X 10.15.4 | Logic Pro X 10.4.8 | FF800 | Nova | SPL 2381 | Luna II | MC TRANSPORT | HR824 | MSP5A | MAX49 | nanoKONTROL2 | nanoPAD2 | LPD8 | LPK 25 | MX1000 | diNovo |
 
User avatar
tenorman
Posts: 18
Joined: Wed Feb 21, 2007 7:30 am
Location: Oshkosh, WI

Re: Change Region Gain With Key Commands

Thu Jul 25, 2019 9:04 am

[quote="speakerfood"]You can use this script. Modify it to go to an exact type, by changing the keycode 125 to match the first letter of the type. If you only use this script, you also need a script to go up in the menu (key code 126 is arrow up.

BTW, this script is an improvement to previous scripts, because it also works when a movie is present or when Control Bar is not shown.

tell application "Logic Pro X"
tell application "System Events"
tell process "Logic Pro X"
set tracks_window to title of first window whose title contains "- Tracks"
if (description of group 1 of window tracks_window = "Control Bar") then
set group_nr to 2
else
set group_nr to 1
end if
if (value of static text 1 of group 1 of list 1 of group group_nr of window tracks_window is "Movie") then
set sub_group_nr to 2
else
set sub_group_nr to 1
end if
tell pop up button 1 of row 14 of outline 1 of scroll area 1 of group sub_group_nr of list 1 of group group_nr of window tracks_window
click
delay 0.2
key code 125
key code 36
end tell
end tell
end tell
end tell

[quote="tenorman"]My apologies for the typo. I meant the Fade Out Type in the Inspector window. There are 4 values: Out, X, EqP, and X S.

The below AppleScript was posted earlier to change the Region Gain (and works perfectly). Can this be modified to change the Fader Out Type?

Thanks for the help!

tell application "System Events"
tell process "Logic Pro X"
tell row 8 of outline 1 of scroll area 1 of group 1 of list 1 of group 2 of (first window whose name contains "- Tracks")
set x to (get value of slider 1)
set value of slider 1 to (x + 30)
end tell
end tell
end tell[/quote][/quote]

I've upgraded to LPX 10.4.6 and the key commands no longer work. Do I need to update the scripts in BetterTouchTool?

Thanks!
Mac Pro 2x 3.46 GHz 6-Core Intel Xeon
OS 10.13.6 64 GB ram
Logic Pro X 10.4.8
MOTU 828es, Focusrite Liquid 56
 
facej
Posts: 537
Joined: Sun Jul 28, 2013 7:00 pm

Re: Change Region Gain With Key Commands

Sat Jul 27, 2019 11:56 am

WRT .1 gain adjustments...
If you click on the Gain field in the region inspector you can use the key commands "-" and "=" to change the gain down or up by .1 dB - If you want to change by 1 dB increments use shift-minus and shift-equal

In fields like ticks the changes are 1 and 10, etc.

This seems to work in lots of places where you would click on the value and use the mouse to raise/lower - basically "faders" .
Logic Pro X 10.4.8, 10.5.1, Logic Pro 10.6.1
OS X 10.15.7, macOS 11.1
iMac19,1 27" - 3.6 GHz Intel 8 Core i9 - 40GB memory - MacBook Air - 3.2 GHz M1 - 16GB memory - 1TB SSD
Behringer XR18 - Behringer X-Touch - iPad Pro 10.5" iOS 14.3
Logic Pro Command of the Day
 
Flove
Posts: 2
Joined: Wed Jul 31, 2019 7:51 am

Re: Change Region Gain With Key Commands

Wed Jul 31, 2019 7:57 am

thanks a lot for sharing this script! this is a great time saver!

just wanted to share that with my version of Logic Pro 10.4.6 and macOS 10.14.5, the correct row number for region gain is 9 and not 8, nor 6.
so here is the updated script that works for me:

tell application "Logic Pro X"
tell application "System Events"
tell process "Logic Pro X"
set tracks_window to title of first window whose title contains "- Tracks"
if (description of group 1 of window tracks_window = "Control Bar") then
set group_nr to 2
else
set group_nr to 1

end if
tell row 9 of outline 1 of scroll area 1 of group 1 of list 1 of group group_nr of window tracks_window
set x to (get value of slider 1)
set value of slider 1 to (x - 10)
end tell
end tell
end tell
end tell
 
User avatar
anp27
Posts: 1728
Joined: Thu Feb 09, 2012 1:25 pm
Location: Brooklyn, New York

Re: Change Region Gain With Key Commands

Wed Jul 31, 2019 10:40 pm

Flove wrote:
just wanted to share that with my version of Logic Pro 10.4.6 and macOS 10.14.5, the correct row number for region gain is 9 and not 8, nor 6.
so here is the updated script that works for me


Thanks so much for this updated script, my custom macro to change region gain is now working again! :D
Mac mini (late 2012 Server) 2.3 Ghz i7, 16GB RAM Macbook Pro 15" (early 2011) 2.3 Ghz i7~2TB Samsung 860 QVO~16GB Ram~macOS Catalina 10.15.7~Logic Pro 10.6.1~Universal Audio Apollo Twin Duo Thunderbolt MKII~KORG microKEY2 61
 
User avatar
tenorman
Posts: 18
Joined: Wed Feb 21, 2007 7:30 am
Location: Oshkosh, WI

Re: Change Region Fade Out Type With Key Commands

Thu Aug 08, 2019 12:46 pm

Hello,

Here's the script I've been using written by speakerfood to change Region Fade Out Type using BetterTouchTool. But since I upgraded to LPX 10.4.6 it doesn't work. Might anyone know how to modify the script so it works again?

tell application "Logic Pro X 10.4.6"
tell application "System Events"
tell process "Logic Pro X"
set tracks_window to title of first window whose title contains "- Tracks"
if (description of group 1 of window tracks_window = "Control Bar") then
set group_nr to 2
else
set group_nr to 1
end if
if (value of static text 1 of group 1 of list 1 of group group_nr of window tracks_window is "Movie") then
set sub_group_nr to 2
else
set sub_group_nr to 1
end if
tell pop up button 1 of row 15 of outline 1 of scroll area 1 of group sub_group_nr of list 1 of group group_nr of window tracks_window
click
delay 0.2
key code 125
key code 36
end tell
end tell
end tell
end tell

Thanks so much for any help!
Mac Pro 2x 3.46 GHz 6-Core Intel Xeon
OS 10.13.6 64 GB ram
Logic Pro X 10.4.8
MOTU 828es, Focusrite Liquid 56
 
speakerfood
Topic Author
Posts: 111
Joined: Sun Mar 21, 2010 2:48 pm
Location: Netherlands
Contact:

Re: Change Region Gain With Key Commands

Fri Aug 30, 2019 12:59 am

I'm not on the newest version of Logic yet, but I suspect you have to change row 15 to 16.