Bad info from Internet Connect through Applescript?

Hey all, I’m new to Applescript, but I think I finally banged out what I wanted and I don’t think I’m getting back the right information. Maybe you all can help.

What I want to do:
Get the current Base Station ID from AirPort configuration through Internet Connect in Applescript.

What’s happened so far:
Can query Internet connect for the AirPort configuration, like so:

tell application "Internet Connect"
	properties of current configuration of application "Internet Connect"
end tell

I should note here that my AirPort card is on, and connected to my home network…if it was not, I could not be sending this post right now. It has a strong wireless signal, shows a base station ID, etc. However, when I run the script, the results window shows the following:

{network name:missing value, network type:0, AirPort power:false, class:AirPort configuration, name:“AirPort”, signal level:0, base station ID:missing value, status:status of AirPort configuration “AirPort” of application “Internet Connect”}

As far as I can tell, it’s essentially saying: Internet Connect is using the AirPort, which is turned off and not connected to any network.

Anyone have any clue about this? Does running it on another machine actually return useful values???

Thanks in advance for any help!
-Zach

Model: PowerBook G4 15"
AppleScript: 1.10.3
Browser: Firefox 1.5.0.1
Operating System: Mac OS X (10.4)

I get the same thing, and came on here to see if it was just me or if others were getting the same results. seems I am not alone, but no idea why or what to do about it :frowning:

Try this:


property theServiceInfo : "/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/networksetup "
set theEnabledServices to {}
set theIPAddressList to {}

set theServiceList to rest of (paragraphs of (do shell script theServiceInfo & "-listallnetworkservices"))
repeat with x in theServiceList --get a list of enabled services
	if the first character of x is not "*" then set the end of theEnabledServices to contents of x
end repeat

set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {" "}
repeat with x in theEnabledServices
	try
		set theIPAddress to do shell script theServiceInfo & "-getinfo " & (quoted form of the contents of x) & "|/usr/bin/grep \"IP address\""
		set theIPAddress to every text item of theIPAddress
		set the end of theIPAddressList to (contents of x) & ": " & (last text item of theIPAddress)
	end try
end repeat

set AppleScript's text item delimiters to oldDelims

On what kind of Mac? Works on my G5, 10.4.8

sorry.

MacBook Pro 2.0, 10.4.8

Can’t help you then – don’t have an Intel Mac, don’t know where they keep stuff.

fair enough, doesn’t matter. :smiley:

I have the same problem but on a PowerBook G4 10.4.9, AppleScript 1.10.7

When I run


tell application "Internet Connect"
	properties
	set aconfig to AirPort configuration "AirPort"
	properties of aconfig
	properties of status of aconfig
end tell

I get


tell application "Internet Connect"
	get properties
		{application service id:"14DE1CFA-B4A5-41DB-9C60-4A49DECCE3DE", connection log:"", current configuration:AirPort configuration "AirPort", version:"1.4.3", frontmost:false, class:application, name:"Internet Connect", status:status of AirPort configuration "AirPort"}
	get AirPort configuration "AirPort"
		AirPort configuration "AirPort"
	get properties of AirPort configuration "AirPort"
		{network name:missing value, network type:0, AirPort power:false, class:AirPort configuration, name:"AirPort", signal level:0, base station ID:missing value, status:status of AirPort configuration "AirPort"}
	get properties of status of AirPort configuration "AirPort"
		{server name:"", protocol:2, seconds connected:0, state:0, seconds remaining:0, bytes sent:0, class:status record, user name:"", message:"", speed:0, bytes received:0}
end tell

But I’m sure I’m connected :slight_smile:

Model: PowerBook G4
AppleScript: 1.10.7
Browser: Firefox 2.0.0.2
Operating System: Mac OS X (10.4)