Skip to main content
Question

Running AppleScript via shell(bash/zsh) expands window to height of desktop. How can I make it fit?


Forum|alt.badge.img+3

This is not a problem with Jamf per se, but I was wondering if someone else has experienced this problem that is quite annoying to me. 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. Does anyone have a clue on how to address this?

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings