Hello Pierre I am trying to make an all in one script to download "homebrew" then "cliclick" then run the script. I have an issue of the terminal needing the sudo password but the rest of the script completing before the user is able to type it in. Is there a way to have "wait" type command until one part of the script has completed to run the rest? I have tried the delay command but have not had any success.
set theKeychain to "testing12345"
set thePassword to "testing12345"
tell application "Terminal"
do script "ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"" & return & "brew install cliclick"
end tell
tell application "Keychain Access"
activate
repeat until frontmost is true
end repeat
end tell
tell application "System Events" to tell process "Keychain Access"
tell menu bar 1
clickmenu item "Keychain Viewer" of menu 1 of menu bar item "Window"
if existsmenu item "Show Keychains" of menu 1 of menu bar item "View" then ¬
keystroke "k" using {command down}
end tell
set theOutline to outline 1 of scroll area 1 of splitter group 1 of splitter group 1 of window 1
set theValue to (characterid 65532) & space & space & theKeychain
if not (exists (row 1 of theOutline whose value of text field 1 is theValue)) then
keystroke "n" using {option down, command down}
delay 1
keystroketheKeychain & return
delay 1
keystrokethePassword & tab & thePassword & return
set {x, y} to position of row 1 of theOutline whose value of text field 1 is theValue
set x to x + 21
set n to 0
repeat with thisValue in (get value of text field 1 of rows of theOutline)
if thisValue contains " testing12345" then exit repeat
set n to n + 1
end repeat
do shell script "/usr/local/bin/cliclick dd:" & x & "," & y & " du:" & x & "," & (y - n * 20)
end if
end tell
Thank you for your help.