Jump to content

Resolution switcher rMBP 15"


Recommended Posts

Posted (edited)

Hi everybody! 
 
Mavericks broke the previous workflow I was using to quickly change resolution on my retina MacBook Pro (15", doesn't work on 13"). I thought that you might enjoy the new one I wrote!
 
2013-11-02%20at%2011.00%20AM%202x.png

 
Usage:
 
'res b' or ⌘⌥^B for 1440*900          (think 'b' as in 'best for retina')
'res h' or ⌘⌥^H for 1680*1050        (think 'h' as in 'hi-res display', like the old 1680*1050 MBP Hi-Res display)
'res f' or ⌘⌥^F for 1920*1200        (think 'f' as in 'full-hd')
 
Download link: https://dl.dropboxusercontent.com/u/34729/Change%20Resolution.alfredworkflow
 
Happy weekend  :D

Edited by Luca Soldaini
Posted

I am sorry to say that this is not working for me on a new MacBook Pro 13" Late 2013 with OS X Mavericks. Console shows:

 

11/2/13 11:17:54.393 PM Alfred 2[19631]: [ERROR] AppleScript Error: {
    NSAppleScriptErrorAppName = "System Events";
    NSAppleScriptErrorBriefMessage = "Can\U2019t get radio group 1 of group 1 of tab group 1 of window \"Built-in Retina Display\" of process \"System Preferences\". Invalid index.";
    NSAppleScriptErrorMessage = "System Events got an error: Can\U2019t get radio group 1 of group 1 of tab group 1 of window \"Built-in Retina Display\" of process \"System Preferences\". Invalid index.";
    NSAppleScriptErrorNumber = "-1719";
    NSAppleScriptErrorRange = "NSRange: {593, 71}";
}
 
- David
Posted

 

I am sorry to say that this is not working for me on a new MacBook Pro 13" Late 2013 with OS X Mavericks. Console shows:

 

11/2/13 11:17:54.393 PM Alfred 2[19631]: [ERROR] AppleScript Error: {
    NSAppleScriptErrorAppName = "System Events";
    NSAppleScriptErrorBriefMessage = "Can\U2019t get radio group 1 of group 1 of tab group 1 of window \"Built-in Retina Display\" of process \"System Preferences\". Invalid index.";
    NSAppleScriptErrorMessage = "System Events got an error: Can\U2019t get radio group 1 of group 1 of tab group 1 of window \"Built-in Retina Display\" of process \"System Preferences\". Invalid index.";
    NSAppleScriptErrorNumber = "-1719";
    NSAppleScriptErrorRange = "NSRange: {593, 71}";
}
 
- David

 

 

David, 

 

can you share a screenshot of your display tab in system preferences? I fear it might be different that the one on the 15". 

 

Luca

Posted (edited)

David, 

 

can you share a screenshot of your display tab in system preferences? I fear it might be different that the one on the 15". 

 

Luca

 

I've got a Retina MBP and I've got the same error with the script.

 

I edited the script to change the radio buttons to 2, 3 and 4 for b, f and h. I also tried hacking around with the radio group number etc. But I guess i don't really know how to figure out what the correct group is.

 

Here's what my Display Prefs look like:

 

https://www.dropbox.com/s/u569odzu4dd3edz/Screenshot%202013-11-05%2011.07.05.png

Edited by theinterned
Posted

ops, it looks like that the preference panel for the 13" display is structured differently (less UI elements with a different hierarchy, I guess)

 

not having a 13" myself, it's kinda hard for me to fix it. The best thing I can do is suggest you to download Accessibility Inspector (it comes with Xcode, see here https://developer.apple.com/library/mac/documentation/Accessibility/Conceptual/AccessibilityMacOSX/OSXAXTesting/OSXAXTestingApps.html for description on how to use it) to figure out the hierarchy of the UI. :(

  • 2 weeks later...
Posted

Hi Luca,

 

it seems to be a nice workflow... But unfortunately i'm german, so it doesn't work on my MBPR with Mavericks in your Version. So i tried to do some litte fixes and translated some  english menu names into german.

on alfred_script(q)
tell application "System Preferences"
	reveal anchor "displaysDisplayTab" of pane "com.apple.preference.displays"
end tell
tell application "System Events" to tell process "System Preferences" to tell window "Integriertes Retina-Display"
	click radio button "Monitor" of tab group 1
	click radio button "Skaliert“ of radio group 1 of tab group 1
	if (q is "f" or q is "F") then
		click radio button 5 of radio group 1 of group 1 of tab group 1
	else if (q is "b" or q is "B") then
		click radio button 3 of radio group 1 of group 1 of tab group 1
	else if (q is "h" or q is "H") then
		click radio button 4 of radio group 1 of group 1 of tab group 1
	else
		return "No matching resolution!"
	end if
end tell
quit application "System Preferences"

end alfred_script

My MBPR doesn't switch either...

 

Can you please give me an advice!?

 

Thanx in advance

Efty

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...