I have a shell script in which I use osascript to display a prompt to the user for selection from a list. The problem here is, when the script is executed via shell, the osascript window size is extended to the size of the screen height, filling the list selection with empty space. When I run the same osascript code from the script editor, the selection fits to the window size. Is there a way to make the window fit the list items (like in the second picture listed below)?
Here's the sample script:
#!/usr/bin/osascript
set magtitles to {"A", "B", "C", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "y", "Z"}
choose from list magtitles
Here's how it looks like when executed via shell:
And here's how it looks like when executed via Script Editor:
I have tested it on Big Sur 11.1 and Big Sur 11.2 beta, both with same results.
osascript
shell script under macOS Big Sur 11.1 and cannot replicate your issue. The dialog window opens the height of thelist
, showing A thru Z with no blank space under Z.