Rotate display?

I just need a simple script to rotate my MAIN DISPLAY ONLY clockwise, and then another script to restore it to standard orientation.
I found this great script which does most of what I want, but it does it to BOTH displays (I have two displays but I only want the main display rotated back and forth).
Can anyone help me modify this script?
Thanks,
Hal
-- Rotate Display on machines running OS X 10.4.x with ATI Radeon cards.
-- This code is offered without any liability implied or explicit.
-- Use it at your own risk.
-- Copyright 2005, 2006 Conrad Albrecht-Buehler
-- NOTE: UI Scripting must be enabled for this to work! Confirm that
-- "Enable access for assistive devices" is checked in the
-- Universal Access System Preference Pane
-- v1.1.20060301 updated to handle displays with the same name.
-- rotation occurs clockwise. To change to count-clockwise
-- comment out the next line, and uncomment the second line
--property rotationDirection : "clockwise"
property rotationDirection : "counter-clockwise"
-- this function gets a list of the display preferences windows.
-- needed if you have more than one display that you want to
-- rotate. Note: PowerBooks will not rotate their built-in
-- LCDs with this script.
on getDisplays()
tell application "System Events"
get properties
tell process "System Preferences"
set allDisplays to every window
end tell
end tell
return allDisplays
end getDisplays
-- This function simply clicks the pop-up button that
-- controls rotation, and selects the next in order
-- (either clockwise or counter-clockwise)
on setDisplay(thisDisplay)
set rotatable to false
tell application "System Events"
get properties
tell process "System Preferences"
tell window thisDisplay
tell tab group 1
click radio button "Display"
tell group 1
try
click pop up button 3
tell pop up button 3
repeat with i from 1 to 4
if selected of menu item i of menu 1 is true then
exit repeat
end if
end repeat
if rotationDirection is equal to "counter-clockwise" then
set rotateMenuItem to ((i mod 4) + 1)
else
set rotateMenuItem to ((i + 2) mod 4) + 1
end if
click menu item rotateMenuItem of menu 1
end tell
-- If "Standard" is selected, no confirmation dialog is displayed.
if rotateMenuItem is not 1 then
set rotatable to true
end if
on error
log "Can't rotate display. It may be the laptop's built in display."
end try
end tell
end tell
end tell
if rotatable then
delay 10
-- After rotation, for some reason the confirmation dialog is always in window 1.
tell window 1
tell sheet 1
click button "Confirm"
end tell
end tell
end if
end tell
end tell
end setDisplay
-- the "main" part of the script
-- activate System Preferences
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.displays"
end tell
-- get all the display preference pane windows
-- and rotate each corresponding display
set allDisplays to my getDisplays()
repeat with i from 1 to length of allDisplays
my setDisplay(i)
end repeat
-- quit system preferences
tell application "System Preferences"
quit
end tell

The easiest would be to change this:
set allDisplays to my getDisplays()
repeat with i from 1 to length of allDisplays
my setDisplay(i)
end repeat
to this:
set allDisplays to my getDisplays()
my setDisplay(1)

Similar Messages

  • Rotated Displays and Screen Resolution

    I have two displays (NEC 1740CX) connected to the 7300 in the Mac Pro by DVI. Both displays are rotated vertically.
    One is set for 270 deg rotation, the other for 90 deg rotation. The resolution for both displays is set to 600x800.
    But for some reason, the info is not remembered on reboot. One display usually comes up properly. The other comes up as an 800x600 screen (small of course, on the vertically rotated display). Sometimes it will flip flop -- and the good/incorrect displays will switch. Sometimes neither display will come up in the correct resolution. It behaves as though the display preferences aren't being saved properly.
    I don't know if this is an nVIDIA/driver problem, or something funky in OS X (10.4.10). But each time I boot up I have to go in and reset the display resolution on at least one of the two.
    Any ideas??
    You can see why I need this seemingly odd arrangement here: http://home.roadrunner.com/~nq5t/IMG_4348.jpg
    Thanks
    Mac Pro   Mac OS X (10.4.10)  

    Try resetting PRAM…
    http://docs.info.apple.com/article.html?artnum=2238

  • Rotate Display in Gnome on wayland

    So the question; is it currently possible to rotate displays in a (dual) display configuration under gnome via wayland?  It is clearly possible under xorg, via randr, but this results in horrible screen tearing on the rotated display when scrolling webpages.  Under wayland, there is no screen tearing (ever), so I think this might be a solution if I can get the screen rotated.  There are obviously many other benefits of wayland as well.  The settings are missing under the default screen utility for gnome, as well as under aranadr.  I am running radeon git drivers and have tested with both the EnablePageFlip and the new TearFree options for xorg to no avail.  Any suggestions?
    Thanks in advance

    bbarcher wrote:
    ooo wrote:
    bbarcher wrote:I don't see the wiki page even mention driver installation. What do I miss? I intend to start a minimum hassle Gnome on wayland session.
    Previously you had to install xwayland and vf86-video drivers patched for it. These days everything required is included in xorg-server 1.16, or rather its development snapshots.
    Could you tell me what is actually missing in current Arch?
    Actually you'll have to wait for Gnome 3.14 if you don't want anything from development snapshot. Because the code in 3.12 only supports the old xwayland (maybe the Gnome developers only cares the stability in Fedora), the code for the Xwayland DDX in Xorg 1.16 has been added in Gnome 3.13 series and will be released with 3.14.

  • Using external LG monitor with 180 degrees rotated display

    Hey everyone,
    I just got a 19" widescreen LG monitor and I have it mounted upside down, so I rotated the display 180 degrees. However, when I move my mouse over links, the arrow jumps a little and is incredibly aggrivating. Has anyone seen this problem? Does anyone know how to fix it? It happens in Safari too and I already tried re-calibrating my monitor and restarting. Thanks.

    Me too, but my LG monitor just stopped working after I installed the recent "Thunderbolt Firmware Update".
    Literally the monitor was working yesterday. This morning I installed the update and now it's broken. Great update.
    Anyone have a fix?

  • Rotate display is gone  from Display-Preferences

    I've had my new MacBook for a week connected to a DVI Samsung 17" LCD monitor. A couple of days ago I lost the portrait mode on the Samsung and checked the Diplay control in System Preferences. The Rotate tool is gone and only "show display in menu bar" is there.
    In doing all the Software Updates is it likely that 10.4.10 knocked out this capability on the MacBook? Has anyone else lost the potrait view on their second desktop? Pity, if so; it's one of the reasons I bought the MacBook over the Pro.
    Message was edited by: David Won1

    The Rotate tool is gone and only "show display in menu bar" is there.
    I use a samsung DVI 19" LCD external display. On my display preferences the show display in menu bar is on the display control for the MacBook. It is not on the display preferences for the external display. In that window is where my rotate is. I also am running 10.4.10 and mine still works perfectly.

  • Rotate display for portrait mode?

    I'd like to rotate the display orientation on my 15" MBP so that I can read documents in portrait mode while holding the laptop sideways. I found some tips instructing me to hold the option key down while selecting the displays pane in system preferences but that doesn't seem to work.
    I found SMSRotateD which is a little demo that rotates the display using the sudden motion sensor:
    http://www.osxbook.com/software/sms/smsrotated/
    It does successfully rotate the display 90 degrees, but it works erratically and won't stay in one orientation for long. I'd rather do this without the SMS. Can anyone tell me how?

    I do though hesitate to rotate the whole body of the machine. Functioning vertically may not be the best of things to do. At least back 10 years ago, and I don't know if it is true now, shifting the drive from the position it was formatted in relative to gravity to a different one for use without reformatting it can shorten the length of the hard drive. This was the case with the drives on some PowerMac 6500s which were formatted vertically and placed horizontally elsewhere.
    Whether or not you can do that with notebook drives regularly, remains to be seen. I'd say it would be better to get an external display that supports the rotation.

  • After rotate, display of large JPEG images very slow.

    I am loading and displaying images using JAI and Java2D.
    When I load a large grayscale JPEG image (300 dpi, letter size), it displays fine.
    After a rotate, the next display is incredibly slow.
    Source is a RenderedImage loaded from a JPEG file using:
         FileSeekableStream ss = new FileSeekableStream(file);
         ImageDecoder dec = ImageCodec.createImageDecoder("jpeg", ss, null);
         RenderedImage source = dec.decodeAsRenderedImage(curPage);
    I create a scaled image using:
         interp = Interpolation.getInstance(Interpolation.INTERP_BILINEAR);
         ParameterBlock params = new ParameterBlock();
         params.addSource(source);
         params.add(xZoom); // x scale factor
         params.add(yZoom); // y scale factor
         params.add(0.0F); // x translate
         params.add(0.0F); // y translate
         params.add(interp); // interpolation method
    RenderedOp image3 = JAI.create("scale", params);
    And display inside the paintComponent() method of my JPanel-derived class using:
         AffineTransform transform = new AffineTransform();
         transform.translate(shiftX, shiftY);
         Graphics2D G2d = (Graphics2D)g.create(); //copy g
         G2d.drawRenderedImage(image3, transform);
    If I add a rotate step after the scale:
         ParameterBlock paramsR = new ParameterBlock();
         paramsR.addSource(source);
         paramsR.add(TransposeDescriptor.ROTATE_90);
         // Create an operator to turn image.
         source = JAI.create("Transpose", paramsR, null);
    Then the next display for a 300 dpi 8 bit grayscale JPEG file can take up to 60 seconds.
    The bulk of the elapsed time is inside: Graphics2D.drawRenderedImage(image3, transform);
    Any ideas what I am doing wrong here?
    I am relatively new to using Java Advanced Imaging.
    Thanks,
    T.J. Brown

    Sorry, a correction.
    The file is actually JPEG-compressed data inside a TIFF file.
    So the decode step uses:
    ImageDecoder dec = ImageCodec.createImageDecoder("tiff", ss, null);
    JPEG inside a JFIF file is much faster.
    Thanks,
    T.J. Brown

  • T60p - unable to rotate display after installing win xp sp3

    Hi,
    I am using WinXP on my T60p. Just installed WinXP sp3 and am now unable to rotate the display using the ATI Catalyst control center.
    I have the latest driver from Lenovo installed (dated 31 jan 2008). There are no drivers to be found at ATI for the Fire GL V5250 display adapter.
    Display driver version is 8.442.3.0.
    Does anyone know of a driver that will fix this problem?
    T60p - 20078JG - 14.1in 1400x1050 LCD- WinXP Pro SP3 - 256MB ATI FireGL V5250 - Advanced Mini Dock - 24" DELL monitor.

    einarjon, welcome to the foum,
    do you mean that the option to rotate is no longer there, or that it is there, but doesn't work?
    Have you tried the key combinations;  Ctrl+Alt+ ← / ↑ / ↓ / →  ?
    Please let us know if this helps.
    Andy  ______________________________________
    Please remember to come back and mark the post that you feel solved your question as the solution, it earns the member + points
    Did you find a post helpfull? You can thank the member by clicking on the star to the left awarding them Kudos Please add your type, model number and OS to your signature, it helps to help you. Forum Search Option T430 2347-G7U W8 x64, Yoga 10 HD+, Tablet 1838-2BG, T61p 6460-67G W7 x64, T43p 2668-G2G XP, T23 2647-9LG XP, plus a few more. FYI Unsolicited Personal Messages will be ignored.
      Deutsche Community     Comunidad en Español    English Community Русскоязычное Сообщество
    PepperonI blog 

  • HP monitor doesn't rotate display when monitor rotated

    I am using a new (to me) HP Optiplex with  windows 7 professional installed.  I installed the drivers for the existing HP w2408h 24" Monitor from the HP website.  It is supposed to rotate the display to the vertical position when the monitor is rotated, as it used to do with the HP computer it was previously attached to.  An attempt to reinstall the drivers resulted in a message that the reinstallation is denied.  Has an one else had this problem?

    Hello Adirondaker,
    Welcome to the HP Forums, I hope you enjoy your experience! To help you get the most out of the HP Forums I would like to direct your attention to the HP Forums Guide First Time Here? Learn How to Post and More. I understand that you are having some issues with the rotation of the display on your monitor, and I would be happy to assist you! 
    Since you are getting an error message that states "reinstallation is denied", this may indicate that you do not have adminstrative rights on your computer. And because your Optiplex desktop is a Dell Computer, you will need to speak with their tech support in order to further troubleshoot the issue on your computer.
    In regards to the software needed for your monitor, you can get your issue more exposure by posting it in the commercial forums, since this is a commercial product. You can do this at: 
    http://h30499.www3.hp.com/t5/Business-PCs-Compaq-Elite-Pro/bd-p/bsc-271
    I hope this helps!
    Regards 
    MechPilot
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the right to say “Thanks” for helping!

  • Air2 iPad rotate display lock?

    AAll my other iPads had a switch near the volume buttons, the air2 does not. How do I stop the display rotation ?

    You need to pull the Control Center up and tap the lock rotation icon.

  • Can Tiger rotate display?

    I have a monitor that can pivot, so that it is oriented as either landscape or portrait. However, it doesn't communicate to the CPU to tell it which way it's oriented (like the iPhone does).
    Is there a way to instruct Tiger to rotate the pixel mapping 90 degrees so that on a pivoting screen, the orientation would be correct? (I'm a newspaper designer, so having a narrow, tall screen would be a huge plus.)

    If it is supported by the monitor it shoud show up in your display preferences. I have an older HP monitor that has no choices when it comes up. My new widescreen Samsung monitor allows me to rotate it any way I want. As you said there are some circumstances where this is good.

  • Cant rotate display on iphone5

    New iphone5. How do I get the display to rotate?

    Note that not all screens will rotate on an iPhone 5. The home screen for example does not rotate.
    The other possibility is that orientation lock is turned on. Swipe up with one finger starting from below the bottom of the home screen to open Control Center. The orientation lock control is at the right end of the top row (looks like a lock surrounded by a partially circular arrow). If it is on, the same icon will display in the menu bar.
    The 3rd possibility is something wrong with the phone. Try a restart; if still not working return for service or replacement.

  • Rotate display nano

    The display on my iPod Nano keeps changing (rotating) it's orientation seemingly at random.    I've checked the settings but can't find anything about this.  Is there a way to turn this off or get back to the factory default?
    I found the answer here:  https://discussions.apple.com/message/17710892#17710892

    Glad to hear you found the answer.
    B-rock

  • Rotate Display with Nvidia 6600

    can I rotate my display 90 degrees?
    I have a Nvidia 6600
    THanks

    I have an Powermac G5 Quad with GeForce 6600.
    I'm not able to rotate the screen of any display. But on older G5 Macs 2.0 Dual with ATI graphicscard I saw the rotate-button in the preferences. (Normal CRT-Displays were used)
    Why is this feature only available with ATI graphic cards???
    Does anyone know?
    Thanks

  • Rotating Display

    Does anyone know if the Macbook supports a second monitor in portrait mode using extended desktop mode?
    Will
      Windows 2000  

    Yes it will. I just did it with my old 15" DVI Apple Flat Screen Studio Display. This suggests to me that the video hardware supports it, which means one should be able to do it on the built-in MacBook screen. I have sucessfully done it temporarily using SMSRotateD from www.osxbook.com, but it will not stay in portrait mode.

Maybe you are looking for