Copy link to clipboard
Copied
Dear All,
How can I find the IP address of my local computer via Javascript. I really appreciate any help of clue on this.
Thanks,
Anil Yadav
Run this code it will give you IP address.
var systemIP = "set theIP to do shell script \"ifconfig | grep 'broadcast' | awk '{print $2}'\"";
var getIP = app.doScript(systemIP, 1095978087);
alert (getIP)
Shonky
Copy link to clipboard
Copied
Run this code it will give you IP address.
var systemIP = "set theIP to do shell script \"ifconfig | grep 'broadcast' | awk '{print $2}'\"";
var getIP = app.doScript(systemIP, 1095978087);
alert (getIP)
Shonky
Copy link to clipboard
Copied
Thanks a lot Shonky and appreciate for quick and correct reply.
Can you please also suggest how to deal the same on PC?
Copy link to clipboard
Copied
Sorry Anil, I have not idea for PC.
But i am sure its possible through vb script on PC.
Shonky
Copy link to clipboard
Copied
Hey!
If you are interested to do same on PC, take look here: http://bit.ly/9LGi4L
tomaxxi
Copy link to clipboard
Copied
Hi Tomaxxi,
First of all thanks for you help. I tried your script on Windows XP-SP3 with InDesign CS4 but it is not working. Neither it shows error nor any message while running from script window.
And when I run the the vbs file seprately it shows the below message
hope it will help to update the script.
Thanks,
Anil Yadav
Copy link to clipboard
Copied
Hey!
Thanks for trying script!
I just tried script on XP SP3 / InDesign CS4, and it works. Have you tried to add this in Javascript file:
alert(myIP);
alert(myGateway);
And error you got is probably because of app call for returning scriptArgs. You can't run vbs file with theese lines active. If you still have trouble, just post here, and I'll try to help you.
tomaxxi
Copy link to clipboard
Copied
oops!
I was assuming that it was written in javascript file.
Its working fine...
Thanks again,
Anil Yadav
Find more inspiration, events, and resources on the new Adobe Community
Explore Now