Re: Get IP Address Help
Re: Get IP Address Help
- Subject: Re: Get IP Address Help
- From: "Reese, Stevan" <email@hidden>
- Date: Thu, 10 Jan 2008 21:49:31 -0800
- Acceptlanguage: en-US
- Thread-topic: Get IP Address Help
By external I assume you mean your public IP address.
I've used something like this before.
set publicip to do shell script "curl -s http://checkip.dyndns.org/ | grep 'Current IP Address'|sed -e :a -e 's/<[^>]*>//g;/</N;//ba' -e 's/ //g'|awk -F \\: '{print$2}'"
If you search for the parts you need you'll find them... There is probably a shorter method.
http://www-h.eng.cam.ac.uk/help/tpl/unix/sed.html
http://bbs.applescript.net/viewtopic.php?id=11315
This is getting a bit off topic so I'll remind you that once you get this working you can paste it in to the Run AppleScript action and create an Automator workflow.
stevan
On ThuJan/10/08 7:04 PM, "Sovereign Diamonds" <email@hidden> wrote:
Is there also a way to find external IP to display in he same dialog box?
Regards
David McMillan
> From: "Brannock Thomas A." <email@hidden>
> Date: Tue, 8 Jan 2008 07:40:55 -0700
> To: "David G.Kahn" <email@hidden>
> Cc: <email@hidden>
> Subject: Re: Get IP Address Help
>
> Use applescript and do this:
>
> set output to do shell script "/sbin/ifconfig en0 | grep 'inet ' | awk
> '{print $2}'"
> display dialog output
>
> Of course you'll have to change the adapter en0 to the one you want
> the IP address for. Also, i can't take credit for this, I found it
> here,http://lists.apple.com/archives/Applescript-studio/2003/Oct/msg00072.html
>
> Tom
>
> On Jan 8, 2008, at 7:24 AM, David G. Kahn wrote:
>
>> Hello all,
>> Could anyone help me create an Apple Script or Automator action that
>> will get my computers IP address and display the address in a dialog
>> window. I know it sounds simple and all you masterful guru's out
>> there I am sure this is child's play, however I have Googled
>> extensive and have not found anything other then saving the ip
>> address to a clipboard.
>>
>>
>> thank you in advance
>> David
>>
>> David G. Kahn
>>
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Automator-users mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>> na.edu
stevan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Automator-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden