This is wierd. After checking around I found that there appears to be no way of toggling the resizable property of a window other than through IB. Huh??!! Maybe I’m wrong, but wouldn’t it make sense to be able to say “set resizable to false”?
Well, there is one property of the NSWindow class that can be jury-rigged to do the job. I used…
tell window "main"
call method "setResizeIncrements:" of object it with parameter {2000, 2000}
set has resize indicator to false
end tell
The resize increment property forces the window to resize in increments provided in the parameters, rather than incrementing in the default 1 pixel increment. If you use a huge number, the user will never be able to drag that far, and will never make it to the next potential increment. To set it back, just issue the call method again with parameters {1,1} and set your indicator back to true.
Thanks a lot jobu for this quick and dirty workaround.
It works like a charm.
You are right in asking for a “set resizable to false” functionality. Perhaps nobody ever noticed it’s missing. If somebody knows a more official solution: please let us know.