Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

0071284

Cancelled
Original poster
Jan 15, 2008
170
31
Is there a way to have multiple startup layouts without using different accounts?

I am using a MacBook and sometimes use an Apple external display with it. I would like to be able to have my MB start differently (auto launch certain programs) when it's plugged into the display than when it's not.

Is this possible?


Thanks for any help.
 
You might be able to do something with an AppleScript, but I'm not good with AS.

Yes you could use Applescript something like this would do it :


set bob to do shell script "system_profiler SPDisplaysDataType"

if bob contains "Status: No Display Connected" then
-- I'm at home open no external display stuff
tell application "Safari" to open
tell application "Skype" to open
tell application "Mail" to open
else
-- I'm at work open everything
tell application "Safari" to open
tell application "Skype" to open
tell application "Mail" to open
tell application "Adobe InDesign CS4" to open
tell application "Adobe Photoshop CS3" to open
end if
 
Yes you could use Applescript something like this would do it :


set bob to do shell script "system_profiler SPDisplaysDataType"

if bob contains "Status: No Display Connected" then
-- I'm at home open no external display stuff
tell application "Safari" to open
tell application "Skype" to open
tell application "Mail" to open
else
-- I'm at work open everything
tell application "Safari" to open
tell application "Skype" to open
tell application "Mail" to open
tell application "Adobe InDesign CS4" to open
tell application "Adobe Photoshop CS3" to open
end if

Well...
First off, thanks for the help.
That being said, my knowledge of programming or script writing is pretty much limited to Hello World.
Do you feel like walking me through this step by step, or do you have a link to somewhere that would help me figure this out?

Thanks either way.
 
Yes sure thats no problem

Open the AppleScript editor application and paste in the script below.

When you have finished tweeking it you need to save it as an Application not a script thats v important or it wont self run on start up.

Next go to system preferences / accounts / login items and click the little + sign to add our script to your start up items and were done.

In terms of tweeking the script what its doing is reading the display info from system profiler that you can see by going to about this mac.

We then stick that info in a variable called bob.

Next we look to see if bob has the words "no display connected" in it so we know which items to open if you have your other display hooked up.

You just need to add your apps to the script as commented.

A try statement surrounds each open command so it doesn't stop if it cant open one of your apps.

Hope thats clear but happy to explain further as required.

-- paste in everything below here and change the apps

set bob to do shell script "system_profiler SPDisplaysDataType"

if bob contains "Status: No Display Connected" then

-- I'm at home open no external display stuff below here
try
tell application "Safari" to open
end try
try
tell application "Skype" to open
end try
try
tell application "Mail" to open
end try

else
-- I'm at work so open everything below here
try
tell application "Safari" to open
end try
try
tell application "Skype" to open
end try
try
tell application "Mail" to open
end try
try
tell application "Adobe InDesign CS4" to open
end try
try
tell application "Adobe Photoshop CS3" to open
end try

end if
 
Andy,

Super cool. Thank you very much.
I had zero problems getting that to work, and it works as it should for both starting with my display and without it.
Awesome job.
I really appreciate it.

Matt
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.