Jump to content

Starting with AutoIt


Recommended Posts

  • Replies 74
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I don't read German at all (I don't even speak Enligsh very well...). Can you translate the main lines for me please, if it is so important ?

I don't know a word German (ok a few) but even so i don't have Firefox so unfortunately I can't help you with that :) Edited by AdmiralAlkex
Link to comment
Share on other sites

  • Moderators

OK, maybe someone who speaks German will, then. And what about my questions @post 19, can't you help me with that either?

Something wrong with taking a little initiative and using an online translator like babelfish? Edited by SmOke_N

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

Here is another question (normally you can answer that one) :

I have to run a program. An error window might appear when i start this program. I want to treat that error.

What should I do ?

I want to use the winwaitactive function, in order to wait for the program to open, but if the error appears, the program won't open, and i don't know what to do, since the script is stopped during that time.

Let's say that the window's error is called "Error".

actual script (that does not treat the error) :

Run("Program")

WinWaitActive("Program window")

Winclose("ProgramWindow")

(I could use a "if" statement, if it was not for the "winwaitactive" function - this winwaitactive function is the problem)

I hope you have understood my question, as my English is not perfect. If not, please say so, I'll try to explain again.

Thanks

Edited by Elishac
Link to comment
Share on other sites

And yet another one :

the window name of the program (which is firefox) has a name, but its name changes after a few milliseconds.

Can i do a command to window wait active for one window name OR (not and, I know how to do that: just use twice the command) another one? (in case the script isnt fast enough to get the first name)

Link to comment
Share on other sites

  • Moderators

The only thing left is the FF.au3 ProgAndy linked to in post #8

Ha, that's great... I'll have to play with that au3, and their TCP stuff.

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

Another one :

is there a goto/label function ? (a function that is composed of 2 parts : when the goto function is read, the script goes to the label function, and continues the script from there).

Example :

$n=1000

Label start

$n=$n+1

If (IsPrime $n) then Return($n) else goto start

(I'm not familiar with the autoit functions yet, so I don't know if the "isprime" and "return" functions exist, but i think you've understood that this script is supposed to give the first prime number that is greater than 1000 - which is 1009. Of course this could be done with a "while" function, but it was just an example.)

Does such a function exist, then ?

Link to comment
Share on other sites

3 more questions, and then i stop until you've answered them all :

- to use the mouse, i need to know its position. how do i know that ? (x and y go from what number to what number?)

- the function that gets the name of the active window is WinGetTitle, right ?

- I want the script to close any unwanted window (such as my firewall's questions) that might appear, during all the script. How can I make the script close it at anytime (not at a particular one) ?

Thanks again for your help.

Link to comment
Share on other sites

1- when i'm not using the autoit script, i want to know the position of my mouse (in order to program it later on) - how do i do that ?

1- x and y go from what number to what number?.

2- ok for winactive.

3- i know that winclose will close the window at a certain time. but i want it to be closed at anytime, as soon as it appears. How to do that ?

Link to comment
Share on other sites

"autoit window info tool with autoit" gives the position of the mouse ?? (can you make full sentences please? it's hard to see what question you're answering to)

what loop ? Can you be more precise ?

Link to comment
Share on other sites

  • Moderators

Check your AutoIt3\Au3Info.exe .

There a bunch of tabs there, with a ton of info, just about everything you can want. I don't think we need to walk you though how to use it.

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

- the tool that comes with autoit, program files\autoit3\autoit3windowinfo.exe, only gives me the x position, not the y. How do i get the y one too?

- I don't want all windows to be closed, just a specific one. Besides, I want it to be closed at anytime, whereas your script will only close the window if the "if" instruction is read. If there are 5000 lines of code, the "if instruction" will only work 1 time out of 5000. I want it to be closed during any command.

The example is simple : While using firefox, if a new window pops up (a window that wasnt launched by the script - for example, from another program, such as the firewall), I want the script to close that window, and then to continue as planned. I don't want to have to write, between each line, <<if winexists("") then winclose("")>>.

Link to comment
Share on other sites

Let me repeat all my questions, and numerate them, so that it's easier for you to answer them :

a. Do you have an idea how to press a link on firefox, using some autoit functions (except : mouse click and tabulation) ?

b. Do you have an idea how to get what is written on Firefox on the bottom-left of the firefox window (where the url appears) ?

c. Do you have an idea how to know if some text is selected ? I want to use ctrl+F to search for a word, but afterwards, how can I access to the string that is selected (I'd want to click the link right above that word). Is there a function or any other way to get the mouse to the selected text ?

d. I have to run a program. An error window might appear when i start this program. I want to treat that error.

What should I do ?

I want to use the winwaitactive function, in order to wait for the program to open, but if the error appears, the program won't open, and i don't know what to do, since the script is stopped during that time.

Let's say that the window's error is called "Error".

actual script (that does not treat the error) :

Run("Program")

WinWaitActive("Program window")

Winclose("ProgramWindow")

(I could use a "if" statement, if it was not for the "winwaitactive" function - this winwaitactive function is the problem)

e. When Firefox starts, its window name changes changes after a few milliseconds.

Is there a command to wait for one window name OR another to appear ?

f. Is there a goto/label function ? (a function that is composed of 2 parts : when the goto function is read, the script goes to the label function, and continues the script from there).

Example :

$n=1000

Label start

$n=$n+1

If (IsPrime $n) then Return($n) else goto start

(I'm not familiar with the autoit functions yet, so I don't know if the "isprime" and "return" functions exist, but i think you've understood that this script is supposed to give the first prime number that is greater than 1000 - which is 1009. Of course this could be done with a "while" function, but it was just an example.)

Does such a function exist, then ?

g. how do i know my mouse position, when I'm not using any script ?

h. The x and y position numbers go from what number to what number?

i. I want my script to close any unwanted window (such as my firewall's questions) that might appear, during all the script. How can I make the script do that, at anytime ?

I hope you have understood all my questions, as my English is not perfect. If not, please say so, I'll try to explain again.

Thanks

Edited by Elishac
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...