Saturday, July 4, 2020

#1 2002-12-09 11:15:34 pm

From:: San Diego
Registered: 2002-12-10
Posts: 2

Determine Connection Method - Newbie

I have a PowerBook.  I take it to work & back to home.
After booting at each location, I need to do a lot of changing of settings, preferences, startup apps, default printer, etc.
As a first step, I would like to have PB, on boot, check which/what connection it has.
What I am trying to do is along these lines:

IF (WorkConnection)
THEN do a whole bunch of stuff
IF (HomeConnection)
THEN do a whole bunch of other stuff
Well, I would have to do setup/config manually.

My (WorkConnection) is to a Win2K network through LAN using smb (Go->Connect to Server and enter address  - of course I have saved in Favorite so I do not have to actually type each time)

My (HomeConnection) is through Airport to cable modem

I do not have a problem actually connecting at each location, I just need a script that detects which connection is present/active, to which I could then add what other things I need done, what other settings/preferences I want.

So as a start, need to detect the connection and test which one it is.

I am newbie to Mac & AppleScript, any help would be greatfully appreciated.  If it is step by step I would really love it.

I have searched around (forums,, etc. etc.) and most of the stuff references only AppleTalk or is OS 9 or before - which I might be able to get to work, but as I am new and using OS X, do not want to go off in wrong direction.

I do understand programming & a fair amount about networking, just weak on OS X & AppleScript.

PowerBook G4 (DVI) 800 Mhz  - 1GB RAM Mac OS 10.2.2



#2 2002-12-10 02:11:47 am

From:: San Diego
Registered: 2002-12-10
Posts: 2

Re: Determine Connection Method - Newbie

OK.  I did manage to piece osmething together:

    tell application "Internet Connect"
        set myCurrentConfig to name of configuration 1
    end tell
    display dialog "Current Config: " & myCurrentConfig buttons {"OK"}
on error
    display dialog "Current Config: error" buttons {"OK"}
end try

3 questions now.
When this runs, it opens Internet Connect, hence the "quit"
How can I do this so that Internet Connect does not open?

I do I get it to "capture" which Airport network it is connected to (I lied above, I also go to a third location) so I need to know "Aiport" vs LAN, but if Airport which network.
I could not find the property to which I need to refer.

Should I be doing this in NSL?

PowerBook G4 (DVI) 800 Mhz  - 1GB RAM Mac OS 10.2.2

Filed under: internet



Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)