Jump to content

How do I get my workflow to wait for a pop-up window to appear?


Recommended Posts

Hello,

 

I have a workflow that I'm working on which basically switches git branches, runs a series of command line instructions and then needs to wait for a pop-up window to appear so that I can enter a password and press continue.

 

I'm not sure how to accomplish the part where the workflow waits for a pop-up window to appear.  Is this possible?

Link to comment

@vitor

The pop window is generated in a part of my workflow where I run the terminal command `make bootstrap`.  It pops up a window as seen below.

 

I want the workflow to know when this pop up has appeared, fill the password and click "OK".

 

2014879110_CleanShot2022-05-11at12_06.49@2x.thumb.png.1bc87da1987c6d29d92fe6241d404451.png

Edited by jswifty
Link to comment
1 minute ago, jswifty said:

where I run the terminal command `make bootstrap`.

 

And how are you running it in your Workflow? If you call it in a Run Script Action, it should halt execution until that command returns (exits). Unless your command returns immediately? What happens when you run it in a terminal, are you back at the command prompt before that dialog disappears? If so, that’s what you need to fix: you need to make it so however you’re invoking the dialog, does not exit before it is gone.

 

open with the -W flag maybe of help (check man open).

Link to comment

@vitor

 

I've attached a screenshot below of how I've set it up.

 

The terminal command is running the actual command, then I wait 30 seconds while the commands are running and the pop-up window appears.  Then, I copy the password to the clipboard and paste it into the active textbox, then click enter using an apple script.

 

The problem is I want to be able to know if that pop up has appeared rather than waiting 30 seconds and assuming it's there.

 

How do I do that?

 

1938912631_CleanShot2022-05-11at16_58.24@2x.thumb.png.3124e90797438889ace0126926a7c425.png

Link to comment
1 minute ago, jswifty said:

The terminal command is running the actual command

 

Do it in a Run Script instead, as suggested above. You don’t need to launch iTerm, either. Also, avoid Run NSAppleScript and prefer instead another Run Script with Language set to /usr/bin/osascript (AppleScript).

Edited by vitor
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...