New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus • Advice and insight from world-class Apple enthusiasts • Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Switch Displays w/ Applescript


Post Reply New Thread Subscribe

 
Thread Tools
photon43

 
Member Since: Jun 14, 2010
Posts: 1
photon43 is on a distinguished road

photon43 is offline
This is one of those things that I think should be really easy to do but for some reason I can't find any useful info on it.

I have one of the new iMac 21" models and a 42" HDTV mounted above it - great for movies and a general media center. Now, when I want to watch a movie I have to do several things to prep for this:

1) Open system prefs and switch the main display to the top 42" screen.
2) Open the desktop and screen saver pane and set the desktop BG to solid black for the lower screen (b/c there is no way to shut it off and having it any other color is distracting during a movie)

Now, none of this is particularly annoying really, But… It does take like 7 or more clicks to get it done.

I would like to automate the whole process of course - b/c I should be able to, there is just no reason why not. I want to run a script that switches the desktop from bottom to top monitor, changes the desktop BG from gray to black at the bottom monitor (the iMac) and then have another script that does this all in reverse (more on this idea below) for when I need to get back to work. It really does not seem like such a tall order but I can find no answers anywhere.

The following script is the best I could find (I did not write this - just modified the paths a bit) but all it does is change the BG of the desktop:

set buttonList to {"work", "movies"}
set colorList to {"Solid Gray Medium", "Solid Black"}
display dialog "Which environment?" buttons buttonList default button 1
set selectedButton to the button returned of the result

repeat with index from 1 to 3
if item index of buttonList = selectedButton then exit repeat
end repeat

set selectedColor to item index of colorList

tell application "Finder"
set desktop picture to {"BobaFett4:Libraryesktop Pictures:Solid Colors:" & selectedColor & ".png"} as alias
end tell

I need it to go a bit further but this is perfect because it eliminates the need for the 'reverse' script I was talking about before because of the buttons it gives me. I could just switch between the two sates (work and movies) at will if I could get some code that would take care of the main display switch along with the BG color switch. But I cant figure out how to take this to the next level. Please help if you can. Thanks!
QUOTE Thanks

Post Reply New Thread Subscribe


« Weird Python or Shell issue | Value for Brightness Control? (color management purpose) »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Switching between 2 Displays imme Other Hardware and Peripherals 0 09-20-2008 07:25 AM
1GB Nano Stuck On Hold; Hold Switch Removed Haselsmasher iPod Hardware and Accessories 0 06-22-2008 11:58 PM
This is My Switch. Nicholi Switcher Hangout 3 06-10-2007 10:43 PM
Apple confirms LED displays in Macs during 2007 kaidomac Apple Rumors and Reports 17 05-04-2007 12:24 AM
Compucable KVM Switch Gryffins Other Hardware and Peripherals 3 08-13-2006 01:52 PM

All times are GMT -4. The time now is 08:58 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?