Starting with AutoIt
#21
Posted 09 May 2008 - 12:24 AM
#22
Posted 09 May 2008 - 12:29 AM
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 thatI 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 ?
Edited by AdmiralAlkex, 09 May 2008 - 12:29 AM.
How to Report Bugs Effectively
Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC Shift
Some of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
#23
Posted 09 May 2008 - 12:30 AM
Edited by Elishac, 09 May 2008 - 12:44 AM.
#24
Posted 09 May 2008 - 01:14 AM
Something wrong with taking a little initiative and using an online translator like babelfish?OK, maybe someone who speaks German will, then. And what about my questions @post 19, can't you help me with that either?
Edited by SmOke_N, 09 May 2008 - 01:14 AM.
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.
#25
Posted 09 May 2008 - 01:19 AM
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, 09 May 2008 - 01:28 AM.
#26
Posted 09 May 2008 - 01:24 AM
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)
#27
Posted 09 May 2008 - 01:27 AM
Ha, that's great... I'll have to play with that au3, and their TCP stuff.The only thing left is the FF.au3 ProgAndy linked to in post #8
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.
#28
Posted 09 May 2008 - 01:37 AM
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 ?
#29
Posted 09 May 2008 - 01:40 AM
Has Dale or Bigdaddy seen it?
Edited by Volly, 09 May 2008 - 01:40 AM.
#30
Posted 09 May 2008 - 01:44 AM
#31
Posted 09 May 2008 - 01:50 AM
- 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.
#32
Posted 09 May 2008 - 01:51 AM
#34
Posted 09 May 2008 - 01:58 AM
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 ?
#35
Posted 09 May 2008 - 02:04 AM
use a loop for the winclose
#36
Posted 09 May 2008 - 02:14 AM
what loop ? Can you be more precise ?
#37
Posted 09 May 2008 - 02:16 AM
a loop is something that will keep going like this:
while 1
if winexists("") then winclose("")
wend
that will keep every window closed forever until the script is shut down
#38
Posted 09 May 2008 - 02:18 AM
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.
#39
Posted 09 May 2008 - 02:35 AM
- 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("")>>.
#40
Posted 09 May 2008 - 02:49 AM
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, 09 May 2008 - 02:50 AM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users




