Skip to main content
Inspiring
December 9, 2024
Open for Voting

P: Shortcut key for ‘constrain crop’

  • December 9, 2024
  • 3 replies
  • 412 views

I use Loupedeck where I can easily press a key for the transform functions'level' or Auto'.  Sometimes it is necessary to use constrain crop on the image, which requires a mouse over to select the box.  It would add to speed and efficiency to have a shortcut key to select that function.

3 replies

jrsforumsAuthor
Inspiring
December 10, 2024

With the multi-step KB actions capabilities of Loupedeck (or Stream Deck) you can avoid need for a shortcut/hotkey.  Again, thanks for the script!!

jrsforumsAuthor
Inspiring
December 9, 2024

John.....Thank you!

johnrellis
Legend
December 9, 2024

While waiting for Adobe to implement this (if ever), here's how you can do that now.

 

Copy these lines into a text file using Textedit or Notepad and save it as "toggle-constrain-crop.lua":

local LrDevelopController = import "LrDevelopController"
LrDevelopController.setValue ("CropConstrainToWarp", 
    LrDevelopController.getValue ("CropConstrainToWarp") == 0 and 1 or 0)

 

Install that file into the Lightroom Scripts folder following these steps:

https://helpx.adobe.com/lightroom-classic/kb/extract-previews-for-lost-images-lightroom.html

 

After restarting LR, you can use the menu command Scripts > toggle-constrain-crop to toggle the Transform > Constrain Crop and Crop > Constrain To Image setting (they're the same).

 

Assign a keyboard shortcut to that script using System Settings on Mac or the free Autohotkey utility on Windows. See these instructions as a guide:

https://johnrellis.com/lightroom/anyvision.htm#shortcuts