Take screenshot, open in Photoshop

A somewhat different take on a macro discussed in another thread:
This can be done in KM:
screenshot to clipboard
switch to Photoshop
new Photoshop document (which automatically inherits the dimensions on the clipboard)
paste

But the hitch comes if Photoshop is not open. Like all Adobe apps, it takes an age to start, and seems to signal the OS that it's open long before you can actually do anything in the app because it's loading libraries or something.
I've tried various timed pauses, and tried pausing until Photoshop is the frontmost app but at some point the delay makes the macro much less useful.

Have you tried asserting a condition that a specific menu item must exist and be active before proceeding with the rest of the macro ? There's an action in the Control Flow category called Until, which allows you to execute a set of actions (which in this case would be a simple delay) until a set of conditions are true, which would probably include Photoshop being the front application and a specific menu item being active.

It looks like this:

but I don't have Photoshop to illustrate it accurately.

Thanks for that idea. I'll check it out.

The Pause Until action is the trick here. It waits for Photoshop to load before continuing the macro, which in this case opens a new file. I've disabled a notification that won't display until Photoshop has actually loaded.

Keyboard Maestro 8.2.1 “Wait For It” Macro

Wait For It.kmmacros (3.8 KB)

mrpasini,
That's what I have tried in the past. What I found was that Photoshop would not accept input for many seconds after the OS thinks it's started and is frontmost.
Maybe I'll try combining this and wait for menu to be available. I haven't tried that before.

BTW, this is all only because I usually modify a screenshot in Photoshop before I use it.

Pause Until does seem a more sensible option than Until. I missed that one.

Given that your end goal is to edit a screenshot in Photoshop, what about creating a macro that pastes the screenshot as a file, then opens that file in Photoshop ?

This particular Pause Until is waiting for Photoshop to display its front window (your window's title may be different, depending on your Photoshop Prefs) at which point it is paying attention to your input.

I skip the newer default window myself in favor of the traditional one because it's faster (although not fast).

That's a good idea. I just did a manual test, and noticed two things:

  1. Photoshop CC 2018 opens much faster than I remember Photoshop opening in the past.
  2. A screenshot saved as a file (Shift Command 4, by default) appears open in Photoshop as soon as Photoshop is fully active. So the OS deals with the delay.

Now, how would I create the step that opens a newly created file when I won't know its name?

Note: Change Default Application to Adobe Photoshop CC 2018. As I don't have Photoshop, I cannot illustrate the last step accurately.

Making progress.
I have Set Variable "Filename" as follows, and can insert it as text and get the exact filename result of command shift 4:
Screen Shot %ICUDateTime%yyyy-MM-dd% at %LongTime%.png
And I think the Open command is working.

But I start with Type the shift command 4 keystroke, and after that action, the macro stops.