gen2brain / dlgs

Go cross-platform library for displaying dialogs and input boxes
BSD 2-Clause "Simplified" License
385 stars 44 forks source link

Fix list on macOS to return false when the user canceled. #29

Closed giladreich closed 3 years ago

giladreich commented 3 years ago

osascript output string will return false when the user cancels the dialog.

giladreich commented 3 years ago

Hi @gen2brain, for uniformity sake I also restricted from providing any items named as false.

Example to reproduce when clicking the Cancel button:

❯ osascript -e 'choose from list {"banana","apple","orange"}'
false
❯ echo $?
0
❯ osascript -e 'choose from list {"banana","apple","orange"} with multiple selections allowed'
false
❯ echo $?
0
gen2brain commented 3 years ago

Merged, thanks!