Jump to content

Small Problem


 Share

Recommended Posts

Hi,

I have a small problem,

iam making a script for a program,

the script is for automaticly put some information in some fields...

i have made a GUI where i put the information and then i can push a button so the script fills it in...

But the problem is that the program have to open some new windows...

and some times it takes some time before the window pop-ups..

how can i make it that my script waits untill the window is there...

so he waits with putting the info on the screen....

Winwaitactive doens't work...

Iam now making something with

Do

ControlFocus ("", "", 5)

Until ControlFocus ("", "", 5)

But that is also not working well

Who can help me?

Thanks...

And sorry for my English

Link to comment
Share on other sites

it is a program that is made by some body in our compagny...

the title of evry window is the same so i can't use that

and can you tell me some more about the class name i have looked whit windowinfo and maybe thats a shot in the right direction...

THanks

Link to comment
Share on other sites

  • Moderators

I'm not sure why WinWaitActive() isn't working, unless you don't know the name of the next window to popup or if it is a child window, I'd probably use the class= option for WinTitleMatchMode, 4.

As an alternative, you could probably do:

Do
    Sleep(10)
Until ControlCommand('WindowName', '', 'ControlID or ClassNameNN', 'IsVisible', '')

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

K thanks,

like i told before winwaitactive doesn't work because the window title (childwindow) is the same...

Yes, but is the class name the same (under the Title using the window info tool).

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

@ SMoke

I tryed but it didn't wait for the window....

GUICreate ("Ratio Invoer Scherm", 410, 540, -1, -1, -1, -1)

GUISetBkColor (0x778899)

$n=GUICtrlCreatePic("H:\Dropbox\ratio\logo.jpg", 210, 450 , 190 , 80)

$n=GUICtrlCreatePic("H:\Dropbox\ratio\bovenbalk.jpg", 10, 10 , 390 , 80)

GUISetState (@SW_SHOW)

If Not ProcessExists("jba system 21.exe") Then

MsgBox(48, "Message", "als Ratio nog niet actief is start het dan alsublieft op, en vul hier de gegevens in van de order.")

Else

MsgBox(48, "Message", "als Ratio nog niet actief is start het dan alsublieft op, en vul hier de gegevens in van de order.")

Endif

Dim $input_1

Dim $input_2

Dim $input_3

Dim $input_4

Dim $input_5

Dim $input_6

Dim $input_7

Dim $input_8

Dim $input_9

Dim $input_10

Dim $input_11

;beschrijving van het invoervak

GUICTRLCreateLabel ( "Item Numer" , 10, 110, 200, 20, -1)

GUICtrlCreateLabel ( "Match code" , 10, 140 ,200 , 20 , -1 )

GUICtrlCreatelabel ( "Klant Naam" , 10, 170 ,200 , 20 , -1 )

GUICtrlCreateLabel ( "Aantal Tracks + speelduur (hh:ss:ff)" , 10, 200 ,200 , 20 , -1 )

GUICtrlCreateLabel ( "Type (keuze uit A, AT, R, E, ET)" , 10, 230 ,200 , 20 , -1 )

GUICtrlCreateLabel ( "Huidige Datum" , 10, 260 ,200 , 20 , -1 )

GUICtrlCreateLabel ( "Copy Protection Methode" , 10, 290 ,200 , 20 , -1 )

GUICtrlCreateLabel ( "Tekst van binnen ring" , 10, 320 ,200 , 20 , -1 )

GUICtrlCreateLabel ( "Timestamp van de image file" , 10, 350 ,200 , 20 , -1 )

GUICtrlCreateLabel ( "Purchase ord.No" , 10, 380 ,200 , 20 , -1 )

GUICtrlCreateLabel ( "Huidige datum +1 werkdag" , 10, 410 ,200 , 20 , -1 )

;Invoer vakken voor de gebruiker

$input_1 = GUICtrlCreateInput ("B123456Z" , 210, 110 , 190 , 20 , -1 )

$input_2 = GUICtrlCreateInput ("123456" , 210, 140 , 190 , 20 , -1 )

$input_3 = GUICtrlCreateInput ("peter" , 210, 170 , 190 , 20 , -1 )

$input_4 = GUICtrlCreateInput ("14" , 210, 200 , 190 , 20 , -1 )

$input_5 = GUICtrlCreateInput ("A" , 210, 230 , 190 , 20 , -1 )

$input_6 = GUICtrlCreateInput ("120207" , 210, 260 , 190 , 20 , -1 )

$input_7 = GUICtrlCreateInput ("0" , 210, 290 , 190 , 20 , -1 )

$input_8 = GUICtrlCreateInput ("test" , 210, 320 , 190 , 20 , -1 )

$input_9 = GUICtrlCreateInput ("120207 1415" , 210, 350 , 190 , 20 , -1 )

$input_10 = GUICtrlCreateInput("130207B021" , 210, 380 , 190 , 20 , -1 )

$input_11 = GUICtrlCreateInput ("130207" , 210, 410 , 190 , 20 , -1 )

;-------------------------------------------------------------------------------------------------------------

$Button_1 = GUICtrlCreateButton ( "Maak part" , 15, 480, 80, 20, -1 )

$Button_2 = GUICtrlCreateButton ( "Exit" , 115,480, 80, 20, -1 )

While 1

$msg = GUIGetMsg()

Select

Case $msg = $Button_1

MaakPart()

Case $msg = $Button_2

Exit

;Sluit het programma af

EndSelect

WEnd

Func MaakPart ()

; Wait for Ratio to become active - it is titled "JBA System 21"

winwaitactive ("JBA System 21")

Sleep (500)

; commando voor het oproepen van begin scherm

Send ("!M")

Sleep (500)

Send ("{enter}")

Sleep (500)

Send ("{enter}")

Do

Sleep(10)

Until ControlCommand("JBA System 21", "Item Master Quick", "", "IsVisible", "")

Send ("2")

A little bit of my code

Edited by pjotterke
Link to comment
Share on other sites

  • Moderators

Yes, your not using a Control ID or a ClassNameNN that is necessary for that function :whistle:.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Until ControlCommand("JBA System 21", "Item Master Quick", "", "IsVisible", "")

If you mean this i have tryed with a Classname but didn't work...

Remove the Item Master Quick... and try this:

I don't know what the classnameNN << (NN) (It's right under ControlID) is, but be sure to replace it.

Do
    Sleep(10)
Until ControlCommand('JBA System 21', '', 'ClassNameNN', 'IsVisible', '')

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

don't work either

Yeah... see I'm not much on the guessing game without an actual app to work with... I've given a few options... the last advice I will give is look at the Opt() options in the help file.

Particularly:

WinTitleMatchMode, 4 + classname=

WinSearchChildren, 1

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...