NEWBIE - Move and Click and Drag

Brand new to this.
Trying to create a macro to use in Lightroom. Everything works except 1 step. Trying to change the White Balance from 'As Shot' to 'Auto'.
I am using the Move and Click and Drag action. I do switch to 'and drag to' as well. To set it up I use the 'Get' button and go to the said buttons in LR but KM is not having it. Takes the WB to 'custom'.
What am I doing wrong?

I don't have Lightroom, but I usually can solve this type of problem. I can't see your windows, but if the drag isn't working, try putting pauses before and after your mouse moves & clicks. E.g., sometimes KM can be "too fast," so before your "click and drag" action, just move the mouse to the target location (with a MOVE ONLY action) then pause for 0.1 seconds before you do the "click and drag" (in a separate action.) Also, turn off "restore mouse position" if you have that turned on for the action (it's an option you can change from the cogwheel for the action. I find it can cause problems.) If you do these things, there's a 50% chance the app will work. Then you can fine tune your solution.

There are six possibilities:

  1. The action is not being run at all
  2. The click is happening before the screen is set as expected for the click
  3. The click is not happing in the right location
  4. The drag is not dragging to the right location
  5. The drag is happening too fast for the application
  6. The application is not accepting the simulated events at all

Turn off the Restore Mouse Location, add a large Pause action before the action to ensure everything else is completed, and if it is not the last action of the macro, temporarily add a Cancel This Macro action after the action and run the macro.

If the mouse does not move, then the problem is likely (1).

If the mouse does not end up at the place that it should be dragged to, then you know that the problem is (3-4).

If it does end up at the right place, temporarily change the action to Just Move, rerun the macro and verify that it ends up at the source location. If not, the problem is (3).

Assuming that it all the above works, but the results are still not what you want, then you know 1-4 are not the problem. Undo the Just Move change to the action and try slowing down the drag by adding the Set Action Delay action before the action and adjust the value to something large like 2 seconds.

:warning: Only configure this action to affect “for this macro”. Permanently changing the speed of the drag (or any of the other settings) is a bad idea.

If that still does not work, then you may have to try breaking the action in to multiple parts:

  • Click and Hold at the start location
  • Pause
  • Just Move
  • Pause
  • Release

Possibility even multiple Just Move actions to move the mouse in parts from source to destination. If all of that fails, then its possible the application is simply refusing to process the simulated drag.

But usually the issue is (1-4), so:

  1. Ensure the action is actually running
  2. Ensure the screen is up to date before the action starts
  3. Ensure the drag starts at the right location
  4. Ensure the drag finishes as the right location
  5. Ensure the drag is not too fast for the application.
  6. Get a new application

Welcome! I've learned there's nothing KM cannot do.

One suggestion is, is just moving the dimensions of the window to something else an option, if you're just trying to change its position rather than actually drag it with the mouse functionality? There are ways to do that, like

tell application "Terminal"
    set bounds of window 1 to {0, 50, 600, 700}
    get bounds of window 1
        --> {0, 22, 600, 672}
end tell

Rather than trying to move the mouse and select from the menu, why not select the menu option to set Auto White Balance with the "Select or Show a Menu Item" action, like this:

(That menu item is only available in the Develop module, so you might want to restrict your macro to only run in that module)

Thank you! Will give it a go.

Thank you for this thorough process. Will see what happens . . .

This did the trick!!! Many thanks for this idea!

Yes. I open LR, cull images then go to the Develop Module before executing the macro.

NEW QUESTION: I would like to have KM execute the same macro on a series of photos then stop after the last photo has been edited. How would I add that to the macro?

I did add the Keystroke 'right arrow' at the bottom of the macro and that was successful in moving to next photo.

I tried adding 'Execute Macro' from Control Flow at the end and it worked beautifully, BUT, it basically went into and infinite loop on the last photo! Was a bit of a trick getting it to stop when it kept grabbing my mouse but I managed to quite LR then KM!

So how do I have KM stop executing the macro after the last photo has had the macro run on it?

It's probably better to start a new topic if you have a new question, as it can be difficult to find the answers in future if there are multiple quesitons and answers in one topic. However...

You'd have to find some way for KM to determine that it's reached the last photo and so knows to stop, or determine how many photos there are to process and then loop that many times.

Before getting bogged down in that though, can you say a little more about what your macro is doing?

From your description is sounds as though you are applying the same set of development steps to each photo. If that's the case it would be much simpler and probably much quicker to define a Lightroom Preset with your settings in it, then select the photos of interest and apply the preset. If you want to apply those settings to all photos in the future you could set that preset to be applied on import and it would be fully automatic.

If whatever you are doing can't be captured in a Lightroom Preset, then please explain it in more detail and someone may be able to figure out how to help.

I shoot Real Estate Photos and Videos (8 years now). I shoot HDR (5 shots, 2 stops apart) so using presets upon import won't work (as far as I can understand).

In LR:

  • Import
  • I stack the photos
  • Then send to my plugin (Enfuse) and they "cook" for 20-30 minutes as a group.
  • Enfuse then produces the HDR image in the LR stack.
  • Then I run the macro on the HDR images

The macro does the following:

  • Lens correction and sharpening (a preset I created)
  • Auto White Balance (to get in the ballpark)
  • Auto adjustments (again, ballpark)
  • Finally another preset that is my 'Special Sauce'.

I've tried to Auto White Balance one then syncing to the others but the sync does just that - syncs the exact WB settings of the initial photo to all the rest - not good. Each photo is different so the WB needs to be photo-specific.

My purpose for using KM is to get each photo 'in the ballpark' and then I tweak each one individually as each photo is uniquely different. I do have presets set up that I use.

It would be nice to be able to have the macro automated to run on each photo in the string then stop after the last one. However, at this moment I am happy to have a macro that does the mouse clicking on each photo so much quicker, and set up in my Stream Deck.

Hope that all makes sense! Thank you so much for your hjelp and any other advice/tips!

I agree you need to import the images and run the HDR process first, but if you have a recent version of Lightroom I believe you can do the rest of it in a preset.

I can't remember exactly when it was introduced, but recent versions of Lightroom allow you to set "Auto Settings" in the preset, and if you apply it to multiple images they are all evaluated individually just as if you had pressed the Auto button in each one. This is a screenshot from LR 13.2:

You should be able to set the white balance to auto, apply your lens corrections and secret sauce, then capture the whole lot in a preset, turning on the Auto Settings in it when you do. Then just apply that preset to your HDR images.

If you have an earlier version of LR which doesn't permit setting "Auto Settings" in presets then we can come back to the macros, but I think an LR preset would be a far easier approach.

Well, don't I feel sheepish! I've been using LR for 15 years. Been in a rut, I would say!
Thank you for this enlightenment Roger. Already set it up and tried it - perfect!
Guess I need to explore a bit more and not rely on old habits & patterns . . . .

1 Like

All that said, I'm looking forward to learning how KM and the Stream Deck can help on so many fronts.