AppleScript to toggle display settings?

I often use Leopard's Screen Sharing capabilities via my Macbook Pro laptop to control my Mac Pro desktop computer. The problem is that my desktop computer is running a dual-monitor configuration, with a 1920x1200 primary screen, and a 2560x1600 30" Cinema Display as my secondary screen, which as you can imagine is pretty difficult to manage from the measly 1440x900 resolution of my laptop.
I was hoping that someone might be able to help me create an applescript (that can be launched with a single click from either the Dock or a Finder Window Toolbar), which I could use to enable the Display Panel option to "Mirror Displays", and then to change the resolution of my Mac Pro's screen to 1600x1000 for reasonable viewing on my Macbook Pro.
If two scripts need to be created for this to work (one to toggle display settings for remote viewing, and another to toggle them back to normal), then that would be fine, but if it's not any more or less difficult to have a single script handle both directions of the toggle, then that would of course be best...
Any help that anyone can offer here would be sincerely appreciated! Thanks so much for your time!

I haven't tested this as I don't have access to a monitor at the moment, but I found this on insanely mac via a google search.
<pre>tell application "System Preferences"
activate
reveal anchor "displaysArrangementTab" of pane id "com.apple.preference.displays"
tell application "System Events"
tell application process "System Preferences"
tell window 1
tell group 1 of tab group 1
click checkbox "Mirror Displays"
end tell
end tell
end tell
end tell
end tell</pre>
Been a few days with no replies so I thought that might work or at least be a nudge in the right direction. Cheers, Joel

Similar Messages

  • Toggle Display Mirroring On/Off - alternate methods?

    Does anyone know if there is a standalone application or script that will simply toggle Display Mirroring on or off?
    Due to a custom setup I'm using, I can't access the menubar or System Preferences to do this.
    I found a terminal utility that sort of does this but it leaves Terminal open after completing the task. I don't know how to tell it to close Terminal when done. Anyone know how to do this or how to integrate in to an Applescript that will do this?
    Here is the link to the software I'm using: http://eruvia.org/software/osxmirroring/
    Thank you!
    Brent

    Let me restate what I think you are saying and asking, just so I am sure I understand; you are using a projector along with the MBP's built-in display so that both are running at the same time, correct? Is this part important to you, meaning do you care that both displays are running or would you be happy to have just the projector running and the MBP's lid closed and screen not running? If that would be OK with you, e.g. just the projector running, then that may be the easiest thing to do to get content displayed on the projector at 1080p full screen.
    If you do care that both screens are running, does it matter to you which is the primary screen, e.g. the screen with the menu bar along the top? Because you could set the projector to be the primary screen by moving the menu bar (under the Displays preferences Arrangement tab) and I believe that would also work to have your content show on the projector at 1080p in most cases.
    Let me know if any of that makes sense because maybe I am completely misunderstanding the issue.

  • Keyboard or terminal commands to change display settings?

    I have a circa 2007 Macbook Pro with a nearly dead display.  The top two thirds of it is dead.  I think it's running Snow Leopard.  When I attach a RGB external display it shows the background and I can drag windows to it, but I cannot seem to move the System Preferences window to a place where I can access the Dislays control panel.  Does anyone know of a way to change the display settings so that the main desktop is mirrored on both displays or how I can grab the System Prefs window and drag it to the other display?

    Try the keyboard combo: CMD + F1 (or OPT +CMD + F1) to toggle mirroring. 

  • I have a late 2008 white macbook.  I have a mini dvi to hdmi adapter, and a hdmi cord.  My cannot get my MB to detect an external monitor.  Nothing happens when plugged in.  Also, my display settings does not have an option for mirroring or arrangment tab

    I have a late 2008 white macbook.  I have a mini dvi to hdmi adapter, and a hdmi cord.  My cannot get my MB to detect an external monitor.  Nothing happens when plugged in.  Also, my display settings does not have an option for mirroring or arrangment tab

    Yeah, I'm having the same exact problem - It seems that the thunderbolt minidisplay port is only able to output the analog VGA signal, not the digital signal to support DVI and HDMI. This is a bug that came up after installing 10.7.1. I bought my macbook air with 10.7 on it, upgraded it to 10.7.1 as soon as I got it, so I have never been able to use hdmi or dvi with my macbook air. This is an extremely frustrating problem for me, I used HDMI on a daily basis with my PC. I have spent many hours at the genius bar running diagnostic tests so Apple can get as much information as possible to create a fix for this problem. I have been emailing tech support for 3 or so weeks now, they keep saying that they are working on a fix and it should be out soon, but 10.7.2 has come and gone and I still have no HDMI functionality with my MacBook Air!

  • Display settings in System Preferences acting up

    I'm having trouble with my Display settings under System Preferences. I am not using an external monitor. My display seems to be working fine, but when I open Display settings to change resolution and colour, weird stuff happens. Basically, I cannot use this preference pane at all.
    My display is 1920x1200, but when I open the Display settings, I get two windows, one telling me that "I am about to change [something something], some applications cannot display information correctly if the screen has less than 800x600 pixels", and the other one, the usual main window, telling me that my resolution is now 640x480 (it isn't).
    If I hit OK in the extra window that pops up, my resolution changes to 640x480 or something similar, and I am unable to change back unless I reboot. Also, in the main Display settings window, it says <<< DO NOT LOCALIZE >>> under the list of available resolutions, as well as << do not localize >> in the box where I can change refresh rate. None of the buttons seem to be working.
    Does anyone have any idea what is going on here? This was working just fine when I received my new MacBook Pro a few days ago, but now it's not. I've been repairing disk permissions and rebooting, etc.
    I have been installing the trial version of Adobe CS5, but had massive problems with this installation (as a lot of people are reporting with CS5 and Snow Leopard...) and uninstalled them again, cleaning out Adobe preference files. Could I have deleted some other important files by accident in this process?

    Quit System Preferences, then delete these files or folders.
    Users/yourname/Library/Preferences /com.apple.systempreferences.plist
    Users/yourname/Library/Preferences/By Host/com.apple.systempreferences.xxxxx.plist and com.apple.PrefPane.Network.xxxxx.plist (the X's will be numbers)
    Also, Users/Home/Library/Caches
    Now relaunch System Preferences. Let us know.
    -mj

  • Im having trouble connecting my macbookpro to the tv. im using a mini display port to hdmi adapter, when i switch tv/video to hdmi on the tv nothing pops up, and i dont have the arrangement tap on the display settings, please help!

    im having trouble connecting my macbookpro to the tv. im using a mini display port to hdmi adapter, when i switch tv/video to hdmi on the tv nothing pops up, and i dont have the arrangement tap on the display settings, please help!

    I've found that the order of operations, so-to-speak, can be important when hooking up mini display port to HDMI.  I have the most success with the following operations in this order:
    1)  Plug HDMI cable into mini displayport adapter (the cable should not be plugged into either the TV or the computer at this point)
    2)  Plug the mini displayport end of your new super-cable to the computer.
    3)  Plug the HDMI end into your TV.
    4)  Switch inputs on your TV to the proper input.
    5)  If still nothing on the TV, try a different HDMI port on your TV.
    Hopefully this helps!  Good luck.

  • VGA CRT will not "wake up".. help please. Reset display settings shortcut?

    Hello everybody,
    I have a mirror drive doors G4 Tower, Dual 1.25 GHz.
    I have an ADC and a DVI out from the computer. Just had damage to my old studio display so I am attempting to use just one CRT running from the DVI... w/ a DVI to VGA adapter.
    The first time I tried this w/ a CRT it worked fine... I played around w/ monitor settings... still worked fine. Shut down... unhooked CRT and moved that CRT away.
    Tried using it with another CRT and the new CRT never started up... remained on stand-by/sleep.
    I tried with another moniter... this time a LCD/Flatscreen... again VGA and it did the same thing, EXCEPT... this time when I connected the LCD to the adapter and then plugged the adapter into the DVI on my tower the LCD screen would turn on for about 1 second and display my login page. The picture was not perfect though... it was distorted someway.
    Went back to the first CRT... now this one didn't work.
    I think that maybe I have to reset my display settings with some sort of shortcut or something... maybe it's on the wrong frequency?
    I don't know... any help much appreciated. I hate having to use this PC.
    Thanks,
    James

    Turned out to be a faulty DVI to VGA adapter.

  • VGA CRT will not "wake up"... help please.  Reset display settings?

    Hello everybody,
    I have a mirror drive doors G4 Tower, Dual 1.25 GHz.
    I have an ADC and a DVI out from the computer. Just had damage to my old studio display so I am attempting to use just one CRT running from the DVI... w/ a DVI to VGA adapter.
    The first time I tried this w/ a CRT it worked fine... I played around w/ monitor settings... still worked fine. Shut down... unhooked CRT and moved that CRT away.
    Tried using it with another CRT and the new CRT never started up... remained on stand-by/sleep.
    I tried with another moniter... this time a LCD/Flatscreen... again VGA and it did the same thing, EXCEPT... this time when I connected the LCD to the adapter and then plugged the adapter into the DVI on my tower the LCD screen would turn on for about 1 second and display my login page. The picture was not perfect though... it was distorted someway.
    Went back to the first CRT... now this one didn't work.
    I think that maybe I have to reset my display settings with some sort of shortcut or something... maybe it's on the wrong frequency?
    I don't know... any help much appreciated. I hate having to use this PC.
    Thanks,
    James
    G4 Dual 1.25 Mirrored Drive Doors Mac OS X (10.4.5) Some NvDia card
    G4 Dual 1.25 Mirrored Drive Doors   Mac OS X (10.4.5)   Some Nvidia Graphics card w/ DVI to VGA adapter

    Can you start up in "safe mode"? If so, you can reset your display settings and reboot. If not, you have a problem either with your video card or your DVI/VGA adaptor

  • Monitor says VIDEO MODE NOT SUPPORTED after changing display settings

    HELP! I am about to have a nervous breakdown with my mac mini! I hooked up the mac to my Philips LCD via DVI. No problem at all. But because the screen is only 15" I wanted to play around with the display settings a bit. So I changed the resolution from it's original 1204x768 to the one higher (not sure of numbers) and to my HORROR, I now can't get any picture at all - it says "VIDEO MODE NOT SUPPORTED". I have tried everything I can think of. I have rest the P-RAM, I have unplugged all cables, plugged the back in again, I bought the mac into work and hooked it up to my monitor and changed the resolution back to 1024x768 which is what it was on originally and that STILL didn't work. I can see the Apple logo and then it goes black and comes up with the error message. HELP! What am I doing wrong - I can't believe one click of a mouse button has rendered my display useless!!!

    Welcome to Apple Discussions!
    Try booting the mini without the display connected, and then, once the system is running, connect the display. This will often force the system to default to a low resolution, and then correctly detect the display when it is connected.
    If that doesn't help, with the display connected, boot into safe mode (hold the shift key down when starting up) and once the system is running, change the resolution to 1024x768, and ensure the correct refresh rate is selected. Rebooting normally ought then to give you a good display.
    If all else fails, boot into safe mode with the display connected, and then in the Finder's file menu, use the 'find' option to search for 'windowserver' (no quotes). You should get 2 or 3 results, including one with a string of alphanumeric characters. Move all of them to the trash and restart normally.

  • HT5219 how do i get my macbook pro 13" retina to keep its display settings the same when I unplug it from my thunderbolt 27" display?

    I have just bought a macbook pro 13" with retina display and a 27" thunderbolt display to go with it.
    I plug in the display, set it all up to the look and format that I want to use (same for both displays, I am using the mirroring feature), and then when I unplug the macbook from the 27" display it's settings revert and I can't see half my windows as they fall off the edge of the smaller macbook screen.
    Is there a way to make the macbook keep the same display settings, even when I unplug it from the 27" display?

    Not that I know of... but if someone comes along with a method, I would certainly be interested...
    Clinton

  • How to reset display settings? 120 hz over HDMI on 2014 MBPr makes screen go black

    Hi, I have a 15" 2014 MBPr with the 750m. Recently, I bought a TV, a vizio M422i-B1. One of my main reasons for buying the TV was to use it as a third display for my mac. I have two displays already connected, a 27 inch 1440 display over thunderbolt, and another 23" display that is 1080 and connected over the other thunderbolt.
    I got the TV mounted above my desk, and ran an HDMI down from the TV to where I put my laptop, and plugged the TV in to the computer in the HDMI port on my mac.
    It worked, but the refresh rate was set at 60 for the TV on my computer, but since my TV is 120Hz, I set the refresh rate in display settings to 120. It worked fine, and the mouse movement on the TV was more normal looking, so I was happy.
    I put the computer to sleep a little later, and came back, and it wouldn't wake up, even after disconnecting all the displays and other peripherals, it would not wake. I restarted the computer, and with nothing connected it rebooted and worked normally.
    I connected everything one by one, USB stuff first, fine. 1440 display over thunderbolt, and everything was fine. same with the 1080 display.
    I went to plug in the TV again, and everything went black. I had to restart the computer without the TV plugged in to do anything. Restarting with the TV plugged in to the mac doesn't fix anything.
    I know my issue is the refresh rate for the TV being set at 120Hz, and I have to change it back to 60 Hz, my problem is that as far as I know I have to have the TV plugged in to change the refresh rate, but if I plug the TV in it kills the computer. Is there a way to reset the display settings so that it doesn't "remember" that I want the TV to be 120Hz?

    Did you ever figure this out?

  • My screen will no longer turn on, how do i reset my display settings on mac pro

    Hi, i'm using a mac pro and cinema HD display, the display was usually set to using the power button on the side as an actual power button, i decided to change it to turn computer sleep mode on and off and it still worked fine whilst it was on, i then turned the set off for the night, the next day the screen did not come on with the computer and i cant turn the screen on becuse the button is set to sleep the computer. Any way to reset my display settings or turn my screen back on?. thnks

    nevermind solved

  • Read Only Display Settings Help

    Hello,
    I am trying to control what some users can see in a page. Right now I have an item field (Roles) display as checkbox. Roles is a field in my table that I created with RolesA, RolesB, RolesC. Note: these are not htmldb roles.
    In my Edit Page Item --> Read Only Display Settings --> Read Only Condition Type --> PL/SQL Function Body Returning a Boolean. Under Expression 1, I coded:
    return not htmldb_util.current_user_in_group(p_group_name => 'APP Admin')
    I want this item to read-only unless the user happens to be a member of group 'APP Admin'.
    The expression is not working. It seems that no matter what user is logged in they can modify this item. Is there another way I can do this for controlling what my RolesA, RolesB, and RolesC can modify? BTW, this item is a checkbox.

    Dung,
    That API seems to have a bug, it returns true/false/null, so you could use 'return not nvl(htmldb_util.current_user_in_group(p_group_name => 'APP Admin'),false)' to get a false value.
    Unfortunately there's another problem: using the read-only attributes for checkbox or radiogroup item makes them hidden. My suggestion would be to create another item that has disabled="disabled" in the HTML Form Element attribute in the item definition and display that item or the non-disabled item alternately, using conditions based on the current_user_in_group logic.
    Scott

  • Display settings

    Hi Experts,
    Is there any other classes available for display settings in ALV other than the below mentioned.The following classes doesn't works in SAP 5.0.
    Is this belongs to NetWeaver family?
    cl_salv_table
    cl_salv_functions
    cl_salv_display_settings
    Can any one pls help it out to do the same in abap objects?
    Regards,
    User

    Hello Raj
    If you are indeed working on an ECC 5.0 system then I do not see where the problem is. The following sample report <b>ZUS_SDN_CL_SALV_TABLE_DISPLAY</b> demonstrates how to adjust the layout of the ALV list. In addition, you see the coding for <i>event handling</i> and <i>column adjustment</i>.
    *& Report  ZUS_SDN_CL_SALV_TABLE_DISPLAY
    REPORT  zus_sdn_cl_salv_table_display.
    TYPE-POOLS: abap.
    DATA:
      gt_knb1        TYPE STANDARD TABLE OF knb1.
    DATA:
      go_table       TYPE REF TO cl_salv_table,
      go_events      TYPE REF TO cl_salv_events_table,
      go_columns     TYPE REF TO cl_salv_columns_table,
      go_column      TYPE REF TO cl_salv_column,
      go_display     TYPE REF TO cl_salv_display_settings.
    PARAMETERS:
      p_outlen       TYPE lvc_outlen  DEFAULT '20',
      p_title        TYPE lvc_title   DEFAULT 'New Grid Title'.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS:
          handle_double_click FOR EVENT
              if_salv_events_actions_table~double_click
              OF cl_salv_events_table
              IMPORTING
                row
                column.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_double_click.
    *   define local data
        DATA:
          ls_knb1    TYPE knb1.
        READ TABLE gt_knb1 INTO ls_knb1 INDEX row.
        IF ( syst-subrc = 0 ).
          SET PARAMETER ID 'BUK' FIELD ls_knb1-bukrs.
          SET PARAMETER ID 'KUN' FIELD ls_knb1-kunnr.
          CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
        ENDIF.
      ENDMETHOD.                    "handle_double_click
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
      SELECT        * FROM  knb1 INTO TABLE gt_knb1
             WHERE  bukrs  = '1000'.
    * Create ALV grid instance
      TRY.
          CALL METHOD cl_salv_table=>factory
    *    EXPORTING
    *      LIST_DISPLAY   = IF_SALV_C_BOOL_SAP=>FALSE
    *      R_CONTAINER    =
    *      CONTAINER_NAME =
            IMPORTING
              r_salv_table   = go_table
            CHANGING
              t_table        = gt_knb1.
        CATCH cx_salv_msg .
      ENDTRY.
    * Create event instance
      go_events = go_table->get_event( ).
    * Set event handler
      SET HANDLER:
        lcl_eventhandler=>handle_double_click FOR go_events.
      PERFORM adjust_column.
      PERFORM adjust_display.
      go_table->display( ).
    END-OF-SELECTION.
    *&      Form  ADJUST_COLUMN
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM adjust_column .
      CHECK ( p_outlen > 0 ).  " In this case use default output length
    * Get columns instance
      go_columns = go_table->get_columns( ).
    * Get single column instance
      TRY.
          go_column  = go_columns->get_column( 'LOEVM' ). " delete flag
          go_column->set_output_length( p_outlen ).
        CATCH cx_root.
      ENDTRY.
    ENDFORM.                    " ADJUST_COLUMN
    *&      Form  ADJUST_DISPLAY
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM adjust_display .
      go_display = go_table->get_display_settings( ).
      go_display->set_striped_pattern( abap_true ).
      go_display->set_list_header( p_title ).
    ENDFORM.                    " ADJUST_DISPLAY
    Regards
      Uwe

  • 2560 x 1600 is gone from my display settings (2nd monitor)

    I've been running my 15" retina macbook pro for more than a year now with 27" DELL monitor and it has alway been using 2560x1600 resolution display.
    In the past year i've had no issues with mirroring my screen to big screen TV using Apple TV, however today something weird happened.
    As usual i mirrored my screen using Apple TV to watch some videos and i had to change some of the display settings to get the best view on my TV.
    Afterwards i switched off the mirroring feature and now my 2nd monitor (DELL 27") is displaying 1920x1080 only. I looked at all my options on my display settings (using ATL+click ) and 2560x1600 is gone missing from the list. Im frustrated and couldn't find an answer to this problem, please advice.
    Couple things i tried;
    - restart & shutdown
    - reset NVRAM & PRAM settings
    - changed mini display cable with another
    - reset monitor settings
    Weird find:
    I tried to mirrored  my macbook pro to apple TV again to see the display settings. Guess what, the option for 2560x1600 is now back on the list and working (visually) just fine. as soon as i turned off the airplay display my 2nd monitor turns back to 1920x1080.
    Note: the display on my retina macbook pro is working just fine, no problem at all. this is only showing on my 27" DELL U2713HM.

    Hello! Just want to ask about mirroring: when you MIRROR the Retina MBP 15" to your Dell Monitor (2560x1600) : do both the MBP and Dell Monitor look sharp and crisp?
    I'm asking because I'm also considering a monitor that's at 2560x1600.
    Thanks so much!

Maybe you are looking for

  • How to use HTTPS with sender SOAP Adapter

    Hi, I am implementing a synchronous SOAP- proxy scenario and on the sender communication channel I have to use the Http Security Level as "HTTPS with client Authentication". Where from I get the certificates to be used in sender Agreement. Please giv

  • Bridge CS4 Meta data in web album

    Hi, I am looking all over for a way which makes it posibly to show ONLY the description meta data in a web album created with adobe bridge cs4. I have been able to have a text for each image in a slide show in every free web album I have tryed. Since

  • Migration from Designer: wrong alias for used table/view in views

    Hello, I am using SQL DM version 3.3.0.744. when importing a view from Designer, a query is build with aliases for the used tables/views which are the same as the table/view name. When using a where clause in Designer, you refer to the alias of the t

  • Where is Reset Safari option on Lion version?

    Trying to talk a friend through clearing a automatic login on a website. But she says Reset Safari isn't in the Safari menu on Lion.....

  • MRP related information

    Hi All, Please provid information on 1) Planning horizon in MRP and its relevance during planning run 2) Planning mode in Planning run. Awaiting your inputs, Thanks, Regards Raghavendra