Jump to content

Recommended Posts

Posted (edited)

Hi,

I have a simple question but i still can't figure it out.

Its whit the program "internet notepad".

I click open file, than the screen loads a wile, but i dont understand how to check when its gone so the next step can taken.

Run("C:\Program Files\InternetNotepad 1.4\InternetNotePad\InternetNotePad!.EXE")
Sleep(1000)
Send ("^o")
; connect screen opens, have to wait till it gone, then activate open screen en open file poppel3.html
[b]WinWaitClose("","Connecting to Internet ..")[/b]
WinActivate("Open")
Send("poppel3.html{Enter}")

The screen name is: "Connecting to Internet .." and the classname is: "classname=#32770 "

The script is hanging on WinWaitClose

Edited by mikezwet2
Posted (edited)

Well its a little complex, i will try to explain

Click open

Takes a few second when open screen opens

Together with this screen a little load screen appears (connect internet server)

When finshed loading the loading screen goes away.

The open screen is not active

So the open screen need to be activated.

After that i can put the filename in the textbox (poppel3.html)

Press enter

File loads

Normally i understand but iam trying all night but no succes :)

I also tryed some if things but thats to mutch for me right now (rookie)

Edited by mikezwet2
Posted

you might check to see if "InternetNotePad" supports opening a file at startup something like:

Run("C:\Program Files\InternetNotepad 1.4\InternetNotePad\InternetNotePad!.EXE poppel3.html")

Otherwise, assuming that the Au3Info tool can see all of these windows, try something like this:

Run that app

; script waits for the window to show up

Winwait("","Connecting to Internet ..")

; script waits for the window to go away

While 1

If WinExists("","Connecting to Internet ..") = 0 Then ExitLoop

Sleep(10)

WEnd

do want you want here

[size="1"][font="Arial"].[u].[/u][/font][/size]

Posted (edited)

Run that app

; script waits for the window to show up

Winwait("","Connecting to Internet ..")

; script waits for the window to go away

While 1

    If WinExists("","Connecting to Internet ..") = 0 Then ExitLoop

    Sleep(10)

WEnd

do want you want here

<{POST_SNAPBACK}>

Alright, i changed a little bit. The script stays in the Sleep even if the loading screen is gone.

Run("C:\Program Files\InternetNotepad 1.4\InternetNotePad\InternetNotePad!.EXE")
Sleep(1000)
Send ("^o")

; script waits for the window to show up
Winwait("Connecting to Internet ..")

; script waits for the window to go away
While 1
If WinExists("Connecting to Internet ..") = 0 Then ExitLoop
Sleep(10)
WEnd

I never came on this solution :) , thanks to herewasplato

Edited by mikezwet2
Posted

You said:

The script stays in the Sleep even if the loading screen is gone.

Is that comment directed at the code above that comment or the code below that comment... in other words, do you still need help? Is your script doing what you want it to do?

Sorry, I do not have the application that you are working with and cannot install right now... but I might be able to help if you still need it.

I avoid WinWaitClose because of this:

"The window is polled every 250 milliseconds or so."

The "If WinExist loop" should work provided the AU3Info tool can see the info that your eyes are seeing. I assumed that you had "Connecting to Internet" in the correct place for your lines of code - either it is the window title or text (visible or hidden) within that window. What does the Info tool say? Can the tool see it? If it is hidden text, do you have the OPT set for that (WinDetectHiddenText)? Do you know how to freeze the Info tool? (Ctrl-Alt-F) Then paste the info to your next post.

later

[size="1"][font="Arial"].[u].[/u][/font][/size]

Posted (edited)

You said:

The script stays in the Sleep even if the loading screen is gone.

Is that comment directed at the code above that comment or the code below that comment... in other words, do you still need help? Is your script doing what you want it to do?

<{POST_SNAPBACK}>

I mean the last code in my text.

The name is the title of the screen, just like a open screen thats named "open".

Here is a screenshot of the load screen (Connecting to Internet ..)

Posted Image

The program demo is downloadable on http://www.dummysoftware.com/inetpad.html

I hope you can help me further with this information

Mayby funny to say, i want to use this script for updating a dynamic ip for a webcam. The script goes to www.whatismyip.com, copies it, opens internet notepad, opens a specified html document, paste the ip in it and saves it. :) I dont understand programs for this specific dns ip updating so i decided to program a autoit script. (Not so easy a tought :D )

Edited by mikezwet2
Posted

Cool - I've never seen anyone post an image of the Info tool... always seen copy/paste of the text. I like the image. [No need for others to post links where others have done this - I'm just saying I've never seen it before.]

Do you have the OPT set for "substring matches" on window titles?

AutoItSetOption ("WinTitleMatchMode", 2)

Suggest that you just use "Connecting to Internet" as the title part of your lines of code... Although, if you copied and pasted from the info tool, then the trailing periods should be correctly spaced.

Perform the steps manually with the Info tool open... does the "Connecting to Internet" window title ever go away?

As an aside:

I would move the ^o as shown below - but that is just a guess and has little to do with why the "If WinExist loop" seems to stick. Also, I would use the window text when available - except in the "If WinExist loop" because the text could change while the connection is made.

AutoItSetOption ("WinTitleMatchMode", 2)

Run("C:\Program Files\InternetNotepad 1.4\InternetNotePad\InternetNotePad!.EXE")

; script waits for the window to show up
Winwait("Connecting to Internet", "Connecting to :")

; script waits for the window to go away
While 1
    If WinExists("Connecting to Internet", "") = 0 Then ExitLoop
    Sleep(10)
WEnd

Sleep(1000)
Send ("^o")

WinWait("Open")
WinActivate("Open")
Send.....

I think that I understand what you are attempting - I got to run for now... I'll check back later to see how this is progressing - perhaps others will solve it for you while I'm away............

[size="1"][font="Arial"].[u].[/u][/font][/size]

Posted

It Works, i have modifed your given script a little bit. I found out that i can activate the "Open" window wile the load screen is loading, in that time the open window is activated and i can send the file text in it.

The line

Winwait("Connecting to Internet ..", "Connecting to :")
was the right one i think, on my way it dind't work.

Opt("TrayIconDebug", 1); Curser on systray icon will give current script line.

AutoItSetOption ("WinTitleMatchMode", 2)

Run("C:\Program Files\InternetNotepad 1.4\InternetNotePad\InternetNotePad!.EXE")

Sleep(1000)
Send ("^o")

; script waits for the window to show up
Winwait("Connecting to Internet ..", "Connecting to :")

WinActivate("Open")
Send ("poppel3.html")

AutoItSetOption ("WinTitleMatchMode", 2)
WinwaitClose("Connecting to Internet ..", "Connecting to :")

Send("{ENTER}")

I am very happy :) , thanks for help.

If i have other questions about the script i will post it here.

Posted (edited)

Well, its fast but i am stucked again.

I have to select a piece of text in a text file like the picture under here shows

After the text is selected the text in clipbord has to be pasted. I know the option ClipPut("") is the one i can use for it.

But i dont know how to select the text

Posted Image

I have this:

Send("{DOWN 5}")
Send("+{RIGHT 15}")

But sometimes the ip have 12 digits (incl points), sometimes 13, or sometime 14 digits. I can't add spaces because the port must be right behind the ip adres.

The Port dont has to be selected, only the ip adres.

A option is to put only the ip adress on a blank line, so the whole line can be selected.

Who knows a better way to select only the ip.

Edited by mikezwet2
Posted (edited)

Hello again after suffering my work because i get ideas again and again about how to fix the problems in this script :)

I have it working 100% now. I post it under here with some notes so you guys can see how i fix my problem i talked about earlyer (digits of the ip)

Thanks a lot for help and learing a lot about AutoIt

Opt("TrayIconDebug", 1); Curser on systray icon will give current script line.

$URL="http://www.whatismyip.com"; goed to website whatismyip.com
Run(@COMSPEC & " /c start iexplore.exe " & $URL)
Sleep(3000); Give IE some time to load
Send("{TAB}"); 3 times tab to go to copie ip url
Send("{TAB}"); carefull no toolbars with fill in fields are active, it could cost a tab
Send("{TAB}")
Send("{ENTER}"); enter for copying this url
Opt("WinTitleMatchMode", 4) 
WinClose("classname=IEFrame", ""); close internet explorer

AutoItSetOption ("WinTitleMatchMode", 2)

Run("C:\Program Files\InternetNotepad 1.4\InternetNotePad\InternetNotePad!.EXE"); opens internetnotepad

Sleep(1000); wait until splash screen dissapear
Send ("^o"); open file

; script waits for the window to show up
Winwait("Connecting to Internet ..", "Connecting to :"); wait till connecting screen appears

WinActivate("Open"); activates open screen wile connection is loading
Send ("poppel3.html"); typ the file wile connection is loading

AutoItSetOption ("WinTitleMatchMode", 2)
WinwaitClose("Connecting to Internet ..", "Connecting to :"); wait until connection load screen dissapear

Send("{ENTER}"); press enter to open file typed earlyer this script

AutoItSetOption ("WinTitleMatchMode", 2)
WinWaitActive("InternetNotePad",""); wait till file is loaded in notepad

Send("{DOWN 5}"); goes five lines down to ip adres, on own line
Send("^+{RIGHT}"); select text till first space means ip adres + port, 10.0.0.138:80/
Sleep(500)
Send ("^v"); paste new ip from copied earlyer from whatsmyip.com
Send (":80/ "); putes :80/ and 1 space (space for next selecting) back
Send ("^s"); save html file

AutoItSetOption ("WinTitleMatchMode", 2)
WinWaitActive("InternetNotePad",""); wait untill html file is uploaded

AutoItSetOption ("WinTitleMatchMode", 2)
WinClose("InternetNotePad", ""); close internet notepad

; this script will execute every 15 minutes to update a dynamic ip adres
; execute with windows scheduler
Edited by mikezwet2
Posted

Glad to see that you figured it out. To replace the IP in that line, I would have suggested selecting the entire line and sending all new info - but you did better and only selected a part of the line.

I'm a big fan of helping a person to script the steps that they think of... and learn whatever they can in the process. However, it is hard sometimes to not suggest a totally different approach to the task at hand.

That having been said, if you ever want to rework this script - you should be able to do all of it without opening a single window. A script that runs in the background.

InetGet should be able to get the IP - such coding has been posted several times to this forum. Here is one:

#72952

You can create and FTP the updated file using one of the FTP scripts:

#73680

...but hey, enjoy your success for a while........

[size="1"][font="Arial"].[u].[/u][/font][/size]

Posted (edited)

Hey this script works great only teh computer stukes after 14 hour.

I have an other idea where i am working on now and have two questions.

Q1: The programm i have to work with dissapears/minimalise in the toolbar in windows where the clock is right under. How do i call it up from there?

Q2: I want to press the "stop server" button like on the screenshot down here. How can i do this? I have tryed the ControlClick but i think its not the right way.

Also made a cap off spy behind the "stop server" button

Posted Image

Edit: mayby its possible to copy the ip left from the stop server button wile its not actief or not selected???? When i click stop server the ip text box is selectable.

Posted Image

Thanks for help...

Edited by mikezwet2
Posted

Edit: mayby its possible to copy the ip left from the stop server button wile its not actief or not selected???? When i click stop server the ip text box is selectable.

Thanks for help...

<{POST_SNAPBACK}>

Q2: I want to press the "stop server" button like on the screenshot down here. How can i do this? I have tryed the ControlClick but i think its not the right way.

ControlClick("webcamXP PRO","","TspSkinButton14","Left",1)

If there's an IP in a button somewhere then try ControlGetText

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Posted

Edit: mayby its possible to copy the ip left from the stop server button wile its not actief or not selected???? When i click stop server the ip text box is selectable.

<{POST_SNAPBACK}>

If no other way to get that IP, then look here.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Posted

Q2: I want to press the "stop server" button like on the screenshot down here. How can i do this? I have tryed the ControlClick but i think its not the right way.

ControlClick("webcamXP PRO","","TspSkinButton14","Left",1)

If there's an IP in a button somewhere then try ControlGetText

<{POST_SNAPBACK}>

This works good, but why is "left" en "1"

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...