jswifty Posted May 11, 2022 Share Posted May 11, 2022 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 Posted May 11, 2022 Share Posted May 11, 2022 Welcome @jswifty, How are you showing your pop-up window? Do you already have it, or are you also asking about how to accomplish that part? Link to comment
jswifty Posted May 11, 2022 Author Share Posted May 11, 2022 (edited) @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". Edited May 11, 2022 by jswifty Link to comment
vitor Posted May 11, 2022 Share Posted May 11, 2022 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
jswifty Posted May 11, 2022 Author Share Posted May 11, 2022 @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? Link to comment
vitor Posted May 11, 2022 Share Posted May 11, 2022 (edited) 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 May 11, 2022 by vitor Link to comment
jswifty Posted May 11, 2022 Author Share Posted May 11, 2022 @vitor Do you have psuedocode type of example that would accomplish this? Link to comment
vitor Posted May 11, 2022 Share Posted May 11, 2022 You have the code. Whatever you have in your Terminal Command object, use in a Run Script instead. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now