Startup options

Discussion in 'Mac Basics and Help' started by Madvillain, Dec 30, 2010.

  1. Madvillain Guest

    Joined:
    Jan 15, 2008
    #1
    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.
     
  2. celticpride678

    Joined:
    Feb 15, 2009
    Location:
    Boston, MA
    #2
    You might be able to do something with an AppleScript, but I'm not good with AS.
     
  3. andy 111r macrumors newbie

    andy 111r

    Joined:
    Nov 13, 2010
    Location:
    leeds
    #3
    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
     
  4. Madvillain thread starter Guest

    Joined:
    Jan 15, 2008
    #4
    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.
     
  5. andy 111r macrumors newbie

    andy 111r

    Joined:
    Nov 13, 2010
    Location:
    leeds
    #5
    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
     
  6. Madvillain, Jan 1, 2011
    Last edited: Mar 15, 2011

    Madvillain thread starter Guest

    Joined:
    Jan 15, 2008
    #6
    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
     

Share This Page