Prompt for User Input | Bring Window "KM User Input" to front?

I recently started working more and more with the "Prompt For User Input Action".

In many cases I have quite a few data to fill into variables that it even would make sense to create a macro that copies/pastes the data from elsewhere into the User Input window. Very often I have bunch of different sources to collect the data for a following action.

For this reason I tried to automate things like…

  1. Copy data from source 1
  2. Paste data into the User Input window
  3. Simulate the Tab key to activate the next field
  4. Activate source 2 to copy data

I tried the action …

"Bring Window(s) With Name Containing “Keyboard Maestro User Input” to Front"

… with all possibilities like "…title containing", "matching" but it didn't work.

Is there a way to bring this window back to front so that I can integrate it to a Macro workflow?

BTW: I like to get things done without scripting to be able to maintain/edit these things by myself on a long term basis.

Thanks in advance.

Show us an example of the sort of thing you're trying to achieve. From the sound of it, you don't need to copy and paste into the user input window at all. You can do the copying at the start of the macro, set variables to the system clipboard contents and reference these in the user input window. It's there some reason you don't want to do this?

3 Likes

Thanks @noisneil for your idea. You're probably right that I could do it the way you recommended and create the variables even totally without the "Prompt…" action. My thought was just that it would be the easiest way because I don't have to deal with all the different "Set Variable to…" because this action is doing it for me really quick and I just have to setup this one and only action.

My current task was to replace some names in a small HTML text block. Like taking the name from a file on an FTP server, the name of a referring image and the name of a product. And this kind of loop for 20-30 of these text blocks.

If I were able to bring the "Prompt…" window to the front it's just as easy as described.

Regardless of workarounds I'd still be interested in the answer if the window is able to bring to the front or not. I remember that I have been at this point before in some different situations and might have the need in the future again if it were possible.

Thanks again!

Assuming you only have only one prompt open:

But you are going to have to set up (at least) 2 macros -- one to display/use the "Prompt for input" dialog and a "controller" macro that calls the first and then loops through popping the dialog and pasting your inputs. And even a simple AppleScript like the above introduces a delay.

You only need the user input window if you need your user to be able to edit the collected data before "submission". If that's not required and you're only trying to avoid creating variables -- use the clipboard history! Copy, copy, copy then use "Set Clipboard to Past Clipboard" action plus "Paste" to put the right thing in the right place.

@noisneil's recommendation to copy to variables first then process them is much the best way -- less fragile than GUI interaction and more understandable when you go back to it in a year's time...

3 Likes

Thanks a lot @Nige_S for your reply and also the script. This might even be very helpful in some other scenarios.

This is a good hint. Thanks also for the idea using the clipboard history. I wasn't considering that.

Again thank you both so much for your help! Much appreciated.