I wrote an AppleScript that goes into System Preferences and clicks on some of the buttons. I does that by literally opening System Preferences and clicking UI Elements. I'm wondering, is it possible to not show what programs AppleScript opened and what it clicked and only show the result, (in my case it changes screen resolution)? That would result in faster script execution.
Asked
Active
Viewed 73 times
0
1 Answers
1
Not directly. You would have to figure out what underlying preferences the UI is changing, and whether there was a way to edit them directly using AppleScript or terminal commands (such as defaults write
-- see man defaults
for details.)
Unfortunately there is no canonical list of preferences that can be edited in this way, although you can find some here. There is also a website dedicated to hidden preference tweaks for OS X and Mac applications: defaults-write.com.
However, for your particular case, I'm pretty sure there is no built-in way to change resolutions from the command line. There is a screenresolution
command that somebody wrote a few years ago, but it doesn't seem to work well with retina resolutions.

calum_b
- 5,921
- 30
- 37
screenresolution
. You can wrap the command in ado shell script
statement if you want it in AppleScript. – user3439894 May 04 '16 at 11:56