question regarding IP address from ipconfig
question regarding IP address from ipconfig
- Subject: question regarding IP address from ipconfig
- From: Jim Weisbin <email@hidden>
- Date: Tue, 21 Aug 2012 14:38:43 -0400
I have a script (actually it's a Filemaker script, but I've listed an un-escaped version here) which gets your internal IP address from ipconfig. Recently I found I had to add "en2" for computers which use a thunderbolt to ethernet adapter. I'm just wondering if this is the best way to do this, or can someone suggest a more elegant, simpler method:
tell application "Finder"
set internalIP to ""
try
set internalIP to do shell script "ipconfig getifaddr en0"
on error
try
set internalIP to do shell script "ipconfig getifaddr en1"
on error
try
set internalIP to do shell script "ipconfig getifaddr en2"
on error
set internalIP to "not found"
end try
end try
end try
display dialog internalIP
end tell
Any help would be appreciated.
--- Jim Weisbin, C.T.O.
Human Music and Sound Design
www.humanworldwide.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden