1

I have reviewed multiple scripts that address primarily changes on a retina display. I have a standard monitor (iMac 27"). The line of code that seems to give me trouble is:

tell application "System Events" to tell process "System Preferences" to tell window "iMac"

I have substituted the name of the window containing the parameters of my monitor (see picture).

What am I doing wrong here? Thanks.enter image description here

5
  • What is giving you trouble with that line? Do you get an error message? I don't seem to have any problem with that line running it myself. See How to create a Minimal, Complete, and Verifiable example for tips on how to create a reproducible problem with a code snippet.
    – grg
    Commented Jun 10, 2018 at 19:28
  • I finally found a script to identify elements of that window. The trouble I am having is with the last function: the choice of the exact resolution I need. I am using: click row 1 of table 1 of scroll area 1 of tab group 1 of window "iMac" I get an error. Maybe "click" is the the correct operator?
    – Stephen
    Commented Jun 11, 2018 at 19:55
  • Edit your question with the script, don't post it as a comment. Narrow it down to the shortest possible script to reproduce the problem.
    – grg
    Commented Jun 11, 2018 at 19:56
  • tell application "System Preferences" reveal anchor "displaysDisplayTab" of pane "com.apple.preference.displays" end tell tell application "System Events" to tell process "System Preferences" click radio button "Display" of tab group 1 of window "iMac" click radio button "Scaled" of radio group 1 of tab group 1 of window "iMac" click row 1 of table 1 of scroll area 1 of tab group 1 of window "iMac" end tell this script returns "missing value" but the UI that I got clearly says row 1 of table 1 of scroll area 1 of tab group 1
    – Stephen
    Commented Jun 11, 2018 at 22:29
  • Comments are ephemeral and don’t support proper formatting, edit your question with the script formatted correctly. This also puts your question into the reopen queue for people to see your question.
    – grg
    Commented Jun 12, 2018 at 7:13

0

Browse other questions tagged .