Check Network/IP in script

I have a Macbook Pro that I use for work and home. I am trying to set up some scripts to automate things based on where I am but I am not sure how to approach this. I'm an AppleScript newbie, but have a development background, so bear with me as I understand how AppleScript does it's thing.
What I want to do is when I close the lid on the MBP and it goes to sleep, have it unmount all drives so there are no corruptions, etc. I have this working using SleepWatcher (http://www.bernhard-baehr.de/) and it's working fairly well.
My next thing is to use the .wakeup script to do some things (mount drives, set default printer, etc) based on where I am. But I'm lazy and don't want to have to set the Network Location.
There are 2 main places I am, but there are others as well. Work is through wired only. Home could be either (though moving to 802.11n so maybe only wireless). Other places are usually wireless and I have a Sprint air card/USB for when on the road.
Is there an "easy" way to check how things are connected in a script? I think I can do the setting but not sure how to check for the different networks.
Thanks!

The easiest solution is to not re-invent the wheel.
Marco Polo

Similar Messages

Maybe you are looking for

  • Filter Where KF Results Row Equal Zero

    I want to write a query that shows cost centre line item data but I only want to see cost centres where the overall amount comes back tro zero. Anybody any idea how I filter out other cost centres where the overall amount doesnt come back to zero? I

  • Clearing Graphics and Sprites problem

    Thanks to Andrei1 for his help previously. Another problem in the same application. Just having problem clearing sprites and graphics. Commented out the clear statements below. Ends up showing nothing. Do I need to create a separate function for init

  • Can't activate my Premiere 1.5. ( updated to 1.5.1 )  Adobe sent me to this forum for help

    After I format and reinstalled my programs I can;t activate my Adobe premiere pro 1.5 ( updated to 1.5.1) . I contacted Adobe at their home page Contact Customer Care , and they send me to this forum for answers. Can somebody please help in a dummy l

  • G710 hard drive read/write speed

    Hello, I have a brand new Ideapad G710  with 1TB Serial ATA 2, 5400rpm with advertised speed of 3 Gb/s (= 384MB/s). I am running Windows 7 ultimate x64 with SP1. When I test hard drive read/write speed (I used CrystalDiskMark) I get results of about

  • How to configure and use labview using java

    I want to configure and use labview in my application using java, please help me out with a solution how i can configure it (like providing input to labview and getting output from labview in java ). Thanks, ATF