• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
question regarding IP address from ipconfig
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: question regarding IP address from ipconfig
      • From: Skeeve <email@hidden>
    • Re: question regarding IP address from ipconfig
      • From: Steve Thompson <email@hidden>
  • Prev by Date: Is there a way to access the Arrange By:
  • Next by Date: Re: Is there a way to access the Arrange By:
  • Previous by thread: Re: Is there a way to access the Arrange By:
  • Next by thread: Re: question regarding IP address from ipconfig
  • Index(es):
    • Date
    • Thread