Automatic graphic switch via Apple Script

hi community,
I would like to change the "Automatic graphics switching" (tick on / tick off) via an Apple Script. I made the following script and it works, except with line "click chckbox 2". Here it ticks the box "Show battery status in menu bar". With "click checkbox 1" it takes the "Lock-Button".
I would be glad if anybode could tell me the right code for ticking the checkbox "automatic graphics switching" via Apple Script.
Thanks a lot
PS: Yes I know that tool gfx Status, but I wanna do this via Apple Script.
tell application "System Preferences"
  activate
          set current pane to pane "com.apple.preference.energysaver"
          delay 0.5
          tell application "System Events"
                    tell process "Systemeinstellungen"
                              tell window "Energie sparen"
  click checkbox 2
                                        delay 0.5
                              end tell
                    end tell
          end tell
  quit
end tell
quit

Hello
You may try this. It works with MacBook Pro 2010 under 10.6.5.
tell application "System Preferences"
    set current pane to pane id "com.apple.preference.energysaver"
end tell
tell application "System Events"
    tell process "System Preferences"
        tell window 1
            tell group 1 -- automatic graphics switching
                tell checkbox 1 -- automatic graphics switching
                    click
                end tell
            end tell
        end tell
    end tell
end tell
And the script below will set the option to the specified value.
set_automatic_graphics_switching(0)
on set_automatic_graphics_switching(i)
        integer i : status of automatic graphics switching
            0 : off (unchecked)
            1 : on    (checked)
    if i is not in {0, 1} then error "Invalid argument: " & i number 8000
    tell application "System Preferences"
        set _was_running to running
        set current pane to pane id "com.apple.preference.energysaver"
    end tell
    tell application "System Events"
        tell process "System Preferences"
            tell window 1
                tell group 1 -- automatic graphics switching
                    tell checkbox 1 -- automatic graphics switching
                        if value ≠ i then click
                    end tell
                end tell
            end tell
        end tell
    end tell
    if not _was_running then
        tell application "System Preferences" to quit
    end if
end set_automatic_graphics_switching
Hope this may help,
H

Similar Messages

  • 10.6.7 update changed desktop image blue Automatic Graphics Switching OFF

    Desktop image changes to default blue whenever you Untick Automatic graphics switching or starting cs4 or other graphics application that uses the AMD graphics or high performance graphics card. Will not change to any other image until you retick the automatic graphics switching. Could be a fault or just Apples way of saying your now using the more powerfull graphics card HOWEVER when you switch back or Tick Auto Graphics Switching it does NOT revert to the image you had.
    Anyone else experiencing this since 10.6.7 update.

    (Oops, time expired on editing my previous post while I had breakfast with the kids.)
    Apple's OS Installer seems picky about which disks it will install onto. It seems to require a disk with an active version of the OS. I've never been able to use Apple's Installer to put OS X onto a blank external Firewire drive, for instance. I'm not sure if it will update any external FW drive, though I can't say that's for certain. I expect the same limitation may be true for attached USB2 drives. Panther installers were picky this way too.
    What I'm looking for is a clear explanation of what Apple's Installer needs to see to make the red exclamation mark go away. It has a very concrete idea about what's an acceptable target drive. Unfortunately, not knowing exactly what it's looking for, I'm at a disadvantage to give it what it wants.
    I'm nearly to the point of calling AppleCare. It seems a bit ridiculous that I'm having so much trouble getting the OS Installer put the original OS that came with my CD-Mini onto my CD-Mini's hard drive. But maybe there's a trick to it I just haven't tried yet.
    BTW, I was using this CD-Mini almost exclusively as a media player below my plasma TV. I'd like to be able to watch some EyeTV recorded shows this week. Right now this CD-Mini is little more than a paperweight due to lack of a workable OS.
    Thanks again.

  • Do all the new MBPs support automatic graphics switching?

    Hi, I read that older MacBooks required a manual switch between the integrated graphics and discrete GPU.
    I'm reading here: http://www.apple.com/macbook-pro/specs/13-and-15-inch/
    "NVIDIA GeForce GT 650M with 512MB of GDDR5 memory (15-inch 2.3GHz configuration) or NVIDIA GeForce GT 650M with 1GB of GDDR5 memory (15-inch 2.6GHz configuration) and automatic graphics switching"
    Does that mean "... 512 MB, or 1GB and automatics graphic switching" -> Only the 1GB configuration supports auto graphics switching, or
    "...512MB or 1GB, and automatics graphics switching -> both configurations support it
    Hate to sound like a grammar freak, but just wondering - never liked having to log in and out to switch.
    Thanks!

    The new MBP's with the Intel 4000 and the NVIDIA cards support automatic graphics switching. You can also use gfxCardStatus, which works with 2012 Mac's an Mountain Lion to make sure that auto graphics switching is enabled.
    Clinton

  • HELP! Macbook Pro lag with automatic graphics switching

    Hi people,
    My macbook pro (2010 edition) recently got laggy. I have no idea whether it is because I installed too many applications or if a hidden application is eating into my RAM. When I turn off the automatics graphics switching to the more powerful Nvidia graphics card, the lagging disappears completely. However, with the switching turned on, lagging occurs in just about every function I use, whether it is to check Microsoft Entourage email, surf safari, or scroll along my dock. The lag is not significant, but many less than a half second of freezing and then resuming. Videos streamed online become more laggy.
    This did not happen before, although I vaguely remember having the automatic graphics switching turned on perpetually when I first bought my MBP as an energy saving measure.
    Does anyone experience this same problem with the graphics switching. Looking for serious help. If not, I think I might try restoring my MBP to its factory settings and see if that helps.
    I updated all software on OS X, running on 4gig ram. I am not sure if it is a memory problem because of the graphic switching situation I mentioned earlier.
    Somebody help me.

    Thanks Clinton,
    I had a funny feeling that would be my only option. It becomes very difficult in my part of the world to get to an Apple store (the nearest one is nearly 2 hours away).
    I would love to find out what the cause is and possible remedies.
    Although far from convenient this maybe my only option.
    Thanks for you help.
    If anyone else has experienced similar issues and already received advice after a trip to the Apple store I would be interested to know more about your experiences / possible solutions.
    Regards,
    Phil

  • Youtube Videos Skip on Automatic Graphics Switching

    This is a feature in the newer models, Specifically Speaking Late 2010 Model.
    In Energy Saver, You have the option to turn on or off Automatic Graphics Switching.
    MBP's with this option usually have 2 Graphics Cards, Intel HD Graphics, and Nvidia Geforce GT 330M.
    If you turn this feature on, You will notice that during playing youtube videos or other videos, the video might lag, or skip.
    To avoid this problem, simply turn off this feature (unselect it).
    The downside to this is more battery usage.
    I did not experience this problem on Snow Lepoard. Only on Lion.
    This problem could be the merge from gMux Version 1.9.21 to 1.9.22
    Please let me know if you experience similar problems, or have found a better solution!

    I've experienced a similar problem with my mid-2010 MBP freezing when on battery power. I've traced the problem to gfxCardStatus switching the GPU to the Intel HD when there are still dependencies for the NVIDIA 330. I stopped using the application and seems to have solved the problem.
    I agree that the problem is prevelant on Lion and didn't occur in Snow Leopard. Your advice to turn off the AGS feature in Energy Saver is a smart one, at least until engineering at Apple resolves this problem, since both gfxCardStatus and AGS are doing the same graphics card switching without reference to actual need of the running apps.

  • "Automatic graphics switching" new option on i5/i7 Snow Leopard for MBP

    Well, I finally upgraded my old 2006 (week 10) MacBook Pro. I'm using a MacBookPro6,2 (i5, mid 2010) with 8G of RAM and 500G of drive space. One of the things I noticed is a new Energy Saver option:
    *[x] Automatic graphics switching*
    *Your computer will automatically switch between graphics modes for better battery life.*
    Interesting, is this a silent "fix" for the Snow Leopard battery problem? This option is not available on pre-i5/i7 MacBook Pro laptops. At least not on the 3 dozen that arrived for one of our clients:
    http://donmontalvo.com/apple/mbpbattery_issue/i5_new_batteryoption.jpg
    Separate thread...didn't want this to be lost in the 1000+ post thread where Google'ers are claiming the problem is strictly related to old batteries that need to be replaced. It doesn't look like this fix will help pre-i5/i7 MacBook Pro users.
    Don

    The new Automatic Graphics Switching feature has been a headache for many users who must run on battery power, because there are many applications that trigger a switch to the higher-powered (and more power-hungry) GPU for no good reason. Many of them barely even use the GPU, and switching to the high-performance GPU does no earthly good when those apps are in use, but it runs the battery down faster anyway. Fortunately, Cody Krieger has written a nifty utility that enables full manual control of which GPU is in use: gfxCardStatus.

  • Automatic Graphics Switching and 10.7.2

    Has anyone else experienced problems with Automatic Graphics Switching on 10.7.2?  After I updated to 10.7.2, I would get either a black or green screen after the chime and and grey screens, so that I would not even see the log in screen.  I reset the PRAM and SMU, reinstalled the combo update, made sure all of the other updates including the Thunderbolt Software and Video Updates were applied, and still I was getting the same problem.  I was able to boot into both Safe Mode and Repair Mode successfully, but there still were no indications of what was causing this problem.
    Finally, I plugged in an external monitor, and I could get the screen to come back both on the LCD as well as the external monitor.  That led me to suspect the Intel HD Graphics 3000 Built-in card.  Once I made sure that Automatic Graphics Switching was unchecked under Energy Saver, the problem went away.  However, the computer is only using the AMD Radeon HD 6750M card, which probably uses up more battery life than the built-in Intel card.
    I conducted an Apple Hardware Test, and everything passed.  I also get the chime at bootup.  I suspect that three System Extensions - AppleIntelHD3000Graphics, AppleIntelHDGraphics, and AppleIntelHDGraphicsFB - all have problems and that this is a software issue.  When I removed them from the System Extensions folder and then put them back in, I got an error message that they had been improperly installed.  Furthermore, when I removed these extensions, the problem went away, even with the Automatic Graphics Switching option enabled, but when I installed the 10.7.2 combo update, the extensions and the problems came back.
    Can anyone else verify that Automatic Graphics Switching under 10.7.2 works for them?  I suppose this still could be a hardware problem, but I strongly suspect there is a software problem with the drivers.  I have a 15-inch early 2011 MacBook Pro, 4 GB, running 10.7.2 and all updates applied.

    In a nutshell, the discreet Nvidia chip supports hardware acceleration in flash, the integrated chip does not.
    For reasons i'm not quite sure of, either Flash, and Automatic Graphics Switching do not really work well together. My guess is that Flash reads the information from the Nvidia Chip (ie that it supports hardware acceleration) and allows the feature to be enabled, but then the apple software does not switch to the Hardware Accelerated chip, because, i guess, it believes that the Intel chip should be sufficient for the job.
    In my experience, forcing the MBP to use the Nvidia chip, and leaving hardware acceleration on provides slightly better battery life when playing supported videos, but, of course unless you remember to re-enable Automatic Graphic Switching again when you're done, it'll kill your battery life later, so I find it safer, unless I am watching a, say, 3 hour long flash video to disable H.A. In flash, and hope that, between them, Apple and Adobe can work this one out... though given their public disagreements over Flash, this could be wishful thinking.
    With HA disabled, you are in no worse a position than you were a few months ago before "Gala" came around, so it's not so bad.

  • Automatic graphics switching & Flash 10.1 breaks fullscreen video?

    Hi,
    I'm on a new i5 MBP and I'm running the latest version of Flash. When I have Automatic graphics switching on and hardware acceleration on in Flash, fullscreen video looks jerky. If I turn AGS off OR turn hardware acceleration off, fullscreen video looks smooth.
    What's going on here?

    In a nutshell, the discreet Nvidia chip supports hardware acceleration in flash, the integrated chip does not.
    For reasons i'm not quite sure of, either Flash, and Automatic Graphics Switching do not really work well together. My guess is that Flash reads the information from the Nvidia Chip (ie that it supports hardware acceleration) and allows the feature to be enabled, but then the apple software does not switch to the Hardware Accelerated chip, because, i guess, it believes that the Intel chip should be sufficient for the job.
    In my experience, forcing the MBP to use the Nvidia chip, and leaving hardware acceleration on provides slightly better battery life when playing supported videos, but, of course unless you remember to re-enable Automatic Graphic Switching again when you're done, it'll kill your battery life later, so I find it safer, unless I am watching a, say, 3 hour long flash video to disable H.A. In flash, and hope that, between them, Apple and Adobe can work this one out... though given their public disagreements over Flash, this could be wishful thinking.
    With HA disabled, you are in no worse a position than you were a few months ago before "Gala" came around, so it's not so bad.

  • Mountain Lion, Automatic Graphics switching not working.

    I have noticed when upgraded to Mountain Lion that my automatic graphics switching is not working as i would expect ..When i start Chrome my discrete graphics Intel 3000 turned off and all i get is AMD HD grapchics without using any graphic intense proccess please help here is my screen shots :
    1: as you will see i have 1 tap open and nothing on the background except ACM 
    2: after 10 minutes writing on this post
         PLEASE HELP.

    I'm not sure that the dialog box indicates which graphics are currently being used? 
    Also, you have Google Chrome running.  It's possible that Chrome invokes the discrete GPU... they acknowledged they had some code in Chrome that was activating the GPU and actually causing kernel panics on the new Retina MacBook Pros recently...

  • How do I stop Automatic Graphics Switching setting automatically reverting

    Macbook Pro 15" Mid 2010
    OS X 10.7.4
    I have a recurring problem where my screen (built in or external monitor/projector) will just go blank at random times. It is an unrecoverable situation and I have to do a hard power reset to get working again.
    After testing several theories without success I struck upon one that showed promise. The blanking tended to occur when I was in Lion Fullscreen mode, or using a gesture to start expose - so I figured maybe it was a graphics switching issue.
    So I went into System Preferences and disabled 'Automatic graphics switching'. I then ran trouble free for several days (I was typically crashing 1-2 times a day)
    Then several days later it happened again and I thought I was back to square one. However, a colleague suggested I check the graphic switching setting to see if something had changed it back, and sure enough it was re-enabled.
    Now I find myself in a constant battle with the system to keep disabling the 'Automatic graphics switrhing' in System Preferences.
    I have tried setting it and locking it, but sooner or later it reverts.
    I need to know if it is possible to force it to stay disabled.

    Nice pace both of you - cheers.
    I have downloaded and installed now (cos I implicitly trust all links in forum responses )
    Oddly enough, since typing my original question this morning (local time) and installing this little utility this afternoon, the setting had once more reverted to 'enabled' - when I selected discrete in the app it crashed my macbook again, but slightly differently from before in that I got a blue screen (felt like windows again ) rather than a blank powered off one.
    Anyway, I have restarted now, and set it again - I'll stick with it for a few days and return with likes/+1/stars etc if it all pans out.
    Cheers again.

  • There is no Automatic Graphics Switching to deactivate

    Hi,
    I have the Dragging Layer in Layer panel -> crash Problem with Photoshop CS4 an Lion.
    The Solution for this should be, to deactivate the automatic graphic switching:
    http://kb2.adobe.com/cps/914/cpsid_91469.html
    But my Energy Saver System Pref. look like this:
    So i can't deactivate this...
    I have the MacBook Pro 13" from 2010 with the Nvidia 320M
    Is there any other way to do this?

    I think i found a way to work with photoshop.. it seems that ps crashs only by draging layers after the mac turn the monitor off to save engery.
    With this settings, photoshop cs4 runs now two days without a crash:

  • Text of "automatic graphics switching" toggle is cutted in Italian language

    It seems to be related to some problem of spacing of the text field, since the Italian translation of "automatic graphics switching" ("cambio automatico scheda grafica") is visually longer than English. I also tried the English language and that problem does not occur.

    It seems to be related to some problem of spacing of the text field, since the Italian translation of "automatic graphics switching" ("cambio automatico scheda grafica") is visually longer than English. I also tried the English language and that problem does not occur.

  • Turning off automatic graphics switching to only allow Intel HD 3000?

    I am trying to configure automatic graphics switching so that it will only ever use the Intel HD 3000 for every single application, and not turn on the the higher end graphics unless I specifically tell it to. Is there a way to do this? Thanks!

    As far as I can determine if you switch auto-switching off in Energy Saver preferences, then the computer will default to the high performance graphics.
    The only possible solution I've come across is this.

  • Retina automatic graphics switching

    Have been having problems with MBP with Retina display. Occasionally when using Safari get blocks of missing data when scrolling forwards and backwards. If Safari is quit then ok for a while...
    Also when in launchpad if clicking on folder link 'other' repeatedly then blocks of pixies appear at top of screen. If Automatic graphics switching is off in energy prefs then launchpad appears to be ok...
    Dose anybody have same problem/s?

    Retina displays are OK. Real problem is with graphic cards Intel HD 4000/Nvidia GT650M. Otherwise retina displays doesn't come only from Samsung but also from LG. If all Retina MacBooks have this problem as you say, it is likely that the problem is with the graphic driver. Or all Retina MacBooks have hardware problem? I hope not. Disable automatic switching graphics this problem fixes, but not 100%. Artifacts at top of the screen will be reduced, but when you look better, there are still small artifacts when you open a folder (most visible when in the folder is approximately 5-6 icons). But what is interesting is that in Safari for example also arise artifacts, but not always. And when they occur, just off and on Safari and the problem is solved. But not forever.
    I'm worried that it will not be resolved with software update. And time goes.

  • Automatic Graphics Switching Problem

    When using slingplayer on my 2010 17" Core i7 Macbook Pro the graphics will switch to the 330M card (as indicated by system profiler and the wonderful gfxCardStatus program).
    The problem is that if I start the program while the intel card is in use the program will start and I will only have audio, no video.
    BUT if I start the program with the 330M already in use by another program (Skype, Parallels, etc...) the program will start with audio AND Video, like it should. (Note: I haven't tried turning off auto graphics switching as I assume it will work)
    I have no idea why and I am not expecting others to have an answer, but has anyone else had any issues like the one I mentioned?

    Hello,
    I had the same problem. This is what fixed what fixed the problem.
    Firstly Turn off automatic graphics switching after that restart your computer (with the cold color). When your computer is on again you will find that it would be fixed.
    Hope it helped

Maybe you are looking for

  • Select range of values in dynpro aplication

    Hi , I have to do some changes on existing dynpro transaction. I have add pop up with two input fields (FROM and TO) After pressing ok button data should be selected d from internal table for all values  between  FROM and TO ( from the screen) . As t

  • Field Service - STAR program is completing with Error message

    Hi Synchronize Territory Assignment Rules (STAR) program is getting completed with following error message: Parameters used were 'Service' with a Run mode as 'Total Refresh'. It errors out with 'No data found' error message. (Log file appended below)

  • [iPhone] How to make a plug-in for Safari?

    Hi! Is there an ability to create a plug-in for Safari on iPhone, which could interact with user (have several buttons and could open webpages with Safari)? If so, please, tell in a few words, how this plug-in can be implemented, which documents have

  • Invoking a WLI 9.2 business process from JSF Controller class

    I want to call a WLI business process from a java class, which will run in the same JVM as the WLI. I have read that JPD Proxy can be used for this purpose. I am concerned with the overhead of RMI calls. Any insight into this would be helpful .

  • Lightroom 4.1 - Importing CR2+jpeg.

    I imported some CR2+jpeg files.  These came from another computer where the jpeg's metadata fields had been thoroughly populated using Bridge, but the CR2's did not. (that computer could not read CR2's from a 5DMarkIII)  I do not know how...and canno