Last active
August 29, 2015 14:04
-
-
Save jazzychad/57938bc656abec5da374 to your computer and use it in GitHub Desktop.
user input prompt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # if you want to capture some kind of user input during a script (e.g. Xcode Run Script Phase) you can use this neato trick | |
| # | |
| # it will give up after 20 seconds of no input and return an empty string, in the case you you hit Build and just walk away | |
| # | |
| # note: only works on macs b/c it uses AppleScript | |
| echo -n $(osascript -e 'set notes to the text returned of (display dialog "Build Notes" default answer "" buttons {"OK"} giving up after 20)') | |
| # e.g. | |
| BUILD_NOTES=`echo -n $(osascript -e 'set notes to the text returned of (display dialog "Build Notes" default answer "" buttons {"OK"} giving up after 20)')` | |
| # then use $BUILD_NOTES elsewhere to store the input |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment