Jump to content
Macro Express Forums

GET IP COMMAND - not quite working...


fjslan

Recommended Posts

In a macro that I have produced I have put in the command to "get IP". the problem is that it gets the computer ip, a 192.168.1.1 address and not the actual IP from the internet.

 

Anyone have a suggestion on what I may be able to do?

 

Thanks in advance..

 

Frank

 

From Help:

"This command will find the IP (Internet Protocol) address of the computer running the macro and save this address to a Text String variable"

 

That sounds like exactly what it did, yes?

 

What are you trying to do?

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

I am trying to get my REAL IP address and then paste it into an excel file followed by a number of vaqriables information.

 

I have come up with...

 

// Get IP ADDRESS = T99

Web Site: http://www.whatismyip.org/ [internet Explorer - Wait to load]

Delay 1.5 Seconds

Window Maximize: Current Window

Delay 1.5 Seconds

Mouse Move Screen 500, 500

Delay 0.5 Seconds

Mouse Left Button Click

Delay 0.5 Seconds

Text Type: <CONTROL>a

Clipboard Copy

Variable Set String %T99% from Clipboard

Delay 0.5 Seconds

Window Close: Current Window

Delay 0.5 Seconds

 

These command go to a website that ONLY lists your IP,

clicks in the middle of the page,

Highlights the IP,

CLIPBOARD copies the ip,

assigns %T99% with the clipboard info.

Closes the windows window.

 

The problem that I am now coming up with is, later in the macro I have the program open up EXCEL and text type a bunch of info.

 

Text Type: %T99%<TAB>%T1%<TAB><TAB>%T2%<TAB><TAB>%N3%<TAB>%T4%<TAB><TAB>%T5%<TAB><TAB>%T6%<TAB>%N...

 

As you can see I have the IP (or %T99%) there to be text typed but, it just so happens to have a carriage return or enter as part of %T99%.

 

You can see this if you go to the "whatismyip.org" ...LCLK in the middle of the page...CTRL-A...CTRL-C then open up notepad and CTRL-V and you will see that the cursor is not at the end of the IP but rtather on the line below it. I have tried to do different text types to get my information on one line in excel but things just arnt working..

 

Hope my solution for IP can help you....

 

Frank

 

ps. Terry, Thanks for all of the help in the past...

Link to comment
Share on other sites

There are several sites that will display your 'internet IP' (as opposed to your 'computer IP', which is what the MX command Get IP delivers). For example:

http://www.lawrencegoetz.com/programs/ipinfo/

http://www.computerhope.com/cgi-bin/systeminfo.cgi

http://www.ipchicken.com/

http://www.liveipmap.com/

 

Using that last one you can get your IP into T99 with this short macro, and it doesn't appear to create a CR/LF in T99:

 

// Get internet IP
Web Site: [url="http://www.liveipmap.com/"]http://www.liveipmap.com/[/url] [Default Browser]
Delay 2 Seconds
Text Type: <TAB><TAB><TAB>
Delay 100 Milliseconds
Text Type: <CONTROL>c
Variable Set String %T99% from Clipboard
Delay 100 Milliseconds
Text Box Display: Result
Macro Return

 

If you want to use your existing code, try adding the command

Variable Modify String > Strip CR/LF

for T99

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...