unset -v input
input="$(/usr/bin/osascript 2>/dev/null <<-'__HEREDOC__'
with timeout of 300 seconds
tell application "Finder"
-- tell application "System Events"
activate
set Input to display dialog "Please enter your password:" \
with title "Password" \
with icon caution \
default answer "" \
buttons {"Cancel", "OK"} \
default button 2 \
with hidden answer \
giving up after 295
return text returned of Input as string
end tell
end timeout
__HEREDOC__
)"
printf "%s\n" "${input}"
open -a 'Script Editor'
with timeout of 300 seconds
tell application "Finder"
activate
set Input to display dialog "Please enter your password:" with title "Password" with icon caution default answer "" buttons {"Cancel", "OK"} default button 2 giving up after 295 with hidden answer
return text returned of Input as string
end tell
end timeout
unset -v input name
export name="$(/usr/bin/whoami)"
input="$(/usr/bin/osascript 2>/dev/null <<-__HEREDOC__
with timeout of 300 seconds
tell application "Finder"
-- tell application "System Events"
activate
set my_name to "${name}"
set my_pass to display dialog "Enter password for " & quoted form of my_name \
with title "Login Window" \
with icon note \
default answer "" \
buttons {"Cancel", "OK"} \
default button 2 \
with hidden answer \
giving up after 295
return text returned of my_pass as string
end tell
end timeout
__HEREDOC__
)"
printf "%s\n" "${input}"