Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all 12506 articles
Browse latest View live

Command Line Compile - Determine Failure?

$
0
0
Why doesn't the command line compiler throw an error or something on failure? When I use Scite to compile, an error is show, but when I compile a script that has an error using the command line, it just quits. I'm trying to write a bulk compiler, but there is no way to determine failures, except if the .exe is not update (modification date / time.)

detect highlighted text

$
0
0
Hi

What I want to do is detect whenever a some text is highlighted/selected in any window

..is there a highlighted event?

I could try to detect mouse drag event perhaps? But it would be better to be able to detect generically when something is highlighted/selected.  

. One solution is to backup the clipboard contents and then do a copy
and if the clipboard is not empty then you know if something is highlighted/selected. But
this requires polling etc.

I have tried detecting mouse up events , but when a mouse up event happens -on a menu  the ^C (copy) - the system beeps.

Is there a is selected /highlighted event..in windows /autoit?

mike

How Can I Get the SRC Parameter of an IMG Object?

Administration?

$
0
0
Where can I report wrongful topic locking?

Learning AutoIt, help needed.

$
0
0
So, I'm stuck with my script.. Basically you enter name for example banana press "+" to add it to the list which will be stored in settings.ini after that when you press start it will open notepad and print out your list. And delete simply clears settings.ini. I haven't been able to figure out how to get multiple items in the list, the old one is always replaced. And also how to print the settings.ini into the list box when I run the script first time.

[ autoit ]    ( ExpandCollapse - Popup )
#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> $IniFile = "Settings.ini" $Form1 = GUICreate("Test", 203, 363, 239, 175) $Input = GUICtrlCreateInput("Enter Name Here", 16, 16, 129, 24) GUICtrlSetFont(-1, 11, 400, 0, "Arial") $Add = GUICtrlCreateButton("+", 160, 16, 25, 25, $WS_GROUP) $List = GUICtrlCreateList("", 16, 56, 169, 253) $Delete = GUICtrlCreateButton("Delete", 16, 328, 81, 25, $WS_GROUP) $Start = GUICtrlCreateButton("Start", 112, 328, 73, 25, $WS_GROUP) GUISetState(@SW_SHOW) while 1 $msg = GUIGetMsg() Switch $msg Case -3 Exit case $Add IniWrite($IniFile, "Names", "item", GUICtrlRead($Input)) $List = GUICtrlCreateList("", 16, 56, 169, 253) GUICtrlSetData(-1, GUICtrlRead($Input), "") Case $Delete IniDelete ("Settings.ini", "Names", "item") Case $Start $ReadList = IniRead($IniFile, "Names", "item", "ERROR") Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send ("This is the list: ") Send ($ReadList) EndSwitch WEnd

settings.ini
[ code='text' ]    ( Popup )
[Names] item=Banana

I was thinking of being able to click and delete one entry from the list instead of clearing it all.. once I get multiple entries on the list even working..
This has been evolving while I've learned new stuff so I'm pretty sure things could be done differently.. in a better way. Help and tips appreciated!

windows home server and send commands

$
0
0
this might be a little out of the scope of these forums but here it is.

im trying to get a script that uses send commands to run on WHS 2003. i set it to run once an hour. ive tested it in win7, XP and ive run it on the server while i was logged in. im logging in remotly using logmein instead of remote desktop and ive changed the settings to not log out when i disconnect. the server already runs thunderbird and utorrent. thunderbird has a plugin that automatically downloads attachments and utorrent runs a web interface so im pretty sure its not logging out or locking itself when i log out. but it just does not run. theres no AV on it or anything.

i read something about setting programs to run as services or something to get them to work but i can find it again. does anyone have any experience with running scripts, (compiled or not) on a headless WHS box? is there something im missing?

Need Simple Error Handler

$
0
0
I have never messed much with error handling but think I need to start :) I have had a complied script running for almost two days and then I did something that caused jupiter to allign with mars and up popped a syntax error (unable to parse statement). Being compiled it didn't really give me any idea where my error was. Is there a simple error handler that someone can point me too that will tell me the module and line number the error happened in even though it is compiled?

Automating Screen Resolution Change - Win7

$
0
0
I'm a new AutoIt user and struggling with what is probably such a basic concept that I haven't been able to find any help on it.

I would like to create a simple script that starts up the Windows 7 Screen Resolution dialog from Control Panel and extends my desktop to each of my three monitors.

I've used Auto v3 Windows Info to capture the address (Address: Control Panel\Appearance and Personalization\Display\Screen Resolution) but I'm not sure how to call the dialog to the screen and then select the Extend Desktop option.

PS. I'm doing this so I can switch from my EyeFinity group which used all 3 monitors for playing games back to Windows for controlling my extended desktop.

Thanks for any help that can be provided.

Including an Executable

$
0
0
Planning to write a script to check if the internet is connected and if so download the newest version of a program to run it but if not run a version that I would like to include in the script once it is compiled. What would be the best way to accomplish this? I am unsure how I would include the program in the script and then check it to see if it is newer or older than the version on my server. I don't know alot about scripting but if someone can point me in a direction for how to setup the folder structure and how I can actually get the exe into my script I think I can make it happen. Thank you in advance for any help or advice you can provide.

[help]Count, replace

$
0
0
Hi everybody :lol:
Sorry for my english ..

Well.. my doubt it's simples i guess, i want to replace some sequence of strings in texts, follow the example:

"Posting aaa New Topic in Generaaaaal Help aand Suport"
I have to replace a sequence of "a" to ", + numbers of sequence" then:
"Poosting ,3 New Topic in Gener,4l Help ,2nd Suport" :graduated:

I don't know, but maybe: :oops:
[ code='text' ]    ( Popup )
position(inicio, end, str) replace(inicio, end, str) $arq = read file.txt $a = "0" $b = "1" $c = "2" $i = 0 $g = 0 $contando = position(i, end file.txt, $a) if $contando = 1 then while $contando = 1 $i = i + 1 $g = position(i, end file.txt, $a) endwhile ;replace a sequence of $a to ",amount" ou if: 000 = ,3 replace(0, $g, "," $i) endif

Please, somebody would help me ?

Thanks !

Newbie Help Please, DOS Shell help

$
0
0
Im trying to make a program that will run a set of Dos commands.. both internal comands and external dos commands (exanple internal dir,copy,rename.. external notepad.exe, calculator.exe...ect.) Im having problems with figuring out which command to use..


The variables will change depending on what you check. Like "DIR /S /P". So the command would be something like ("DIR" $var1 $ver2) or something like that.. It will also need it to export and import setting too.

****************************************
* Dir [x] /s [ ] /p   [ ] /w  [ ] /L *
* notepad [ ] test1.txt   [x] test2.txt *
****************************************
so dir would run in shell window "dir /s" then notepad will open a file called test2.txt
so if "/s" is checked and "/p" is checked the $var_dir = /s /p
so $var_dir=var1+var2

ShellExecuteWait, Run, RunWait, RunAs, RunAsWait
if someone can tell me wich one I should run for it.
And where can I get info on how to import/export data of setting for what is checked for later recovery of settings.. if someone can point me in the right drection.

I tried

$var1="text1.txt"
Run(@WindowsDir & "\notepad.exe $var1" , "", @SW_MAXIMIZE)

That didnt work, it opened notepad and tried makeing a file called $var1 not the data of var1.. I'm new to AutoIT but have a lot of experince with DOS batch files. I'm trying to make some of them with GUI's.
Thanks for any help
Newbie
Rob

How to get a parameter from a USB device > pic included

$
0
0
Posted Image

I need to be able to get information from this field to check to see if it exists, aka is plugged in still. Is that possible? If so, what would I need to be able to get that string?

Any easy way to generate some code for a script?

$
0
0
Or am I left to do these sort of things manually?

Like for example, I have this on line 22 of my script:

send ("{DOWN}{ENTER}")

then 25 lines later, on line 47 I have:

send ("{DOWN}{DOWN}{ENTER}")

again another 25 lines later, on line 72 I have:

send ("{DOWN}{DOWN}{DOWN}{ENTER}")

You get the idea.... basically adding another {down} each time. I need to do this for about 15-20 more times.

Is there a command in Autoit that you can direct me to, that tells it to add another key press automatically or something?

how to let a user write a message and then save it to a file

$
0
0
hi :bye:  I'm new to autoit and can you tell me how to let a user write a message and then save it to a file
this is what i've coded so far and its working fine but its not suitable for a longer message with multiple lines
can you tell me how can i do that
thank you :idiot:

#include <File.au3>
$var = "msg.txt"
$num = InputBox("email address", "please enter your email address", "r2dak@exmaple.com", "",270,130)
$txt= InputBox("write your text ", "Write your Message", "your text here", "",270,130)
_FileWriteToLine($var, 1, "name: " & $num , 1)
;_FileWriteToLine($var, 13, "Date:" & $dnt , 1)
_FileWriteToLine($var, 2, "msg :" & $txt , 1)
MsgBox(64, "Thank you","thanks we will respond soon")

ImageSearchArea help !

$
0
0
The code of ImageSearchArea ( ImageSearch.au3 ) :

_ImageSearchArea($findImage,$resultPosition,$x1,$y1,$right,$bottom,ByRef $x, ByRef $y, $tolerance)

if I want to search an entire area 300x400 of image and the address at the top/left is 510/420 , what is $x1 , $y1 , $right and $bottom ???
Please explain for me . Thanks :)

Why doesnt regex match script tag?

$
0
0
Hello

I am trying to remove script from html file.

Sofar I've managed to come up with this:

[ autoit ]    ( Popup )
StringRegExpReplace($data,"(<script.*?>.*?</script>)","")
I also tried:
[ autoit ]    ( Popup )
StringRegExpReplace($data,"(<script(\s|.*?)>(\s|\n|.*?)</script>)","")


but it doesnt really remove script tag. That tag contains multi line script.

Does anyone know know what how to write right regex pattern for this job?

Help with stringreplace

$
0
0
I am writting a crypter \ decrypter but this crypt part isn t working fine.
It replace the string but after that it displays the unecripted string too.
What s the error?
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <String.au3>
#Region ### START Koda GUI section ### Form=
$Form3 = GUICreate("Test string", 405, 294, 202, 132)
$Button1 = GUICtrlCreateButton("Crypt", 168, 256, 75, 25)
$Edit1 = GUICtrlCreateEdit("", 104, 48, 185, 89)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$texto = GUICtrlRead( $Edit1 )
$4 = StringReplace( $texto, "a", "1H890", 1, 1 )
$5 = StringReplace( $texto, "b", "A9D8o", 1, 1 )
GUICtrlSetData( $Edit1, $5 & $4 )
EndSwitch
WEnd

Can't execute compiled Scripts - "Unable to open script file"

$
0
0
When I want to execute compiled scripts, a error message saying "Autoit Error - Unable to open script file" comes up.
This happens with every script I compile, independent of the code.
Sometimes it works, sometimes it doesn't work again.
When I reinstall Autoit or restart my computer, it sometimes works again.
But i don't want to do this everytime i compile a script.
Does anyone know why it doesn't work and what I should do?

Why I got @error executing this code?

$
0
0
[ autoit ]    ( Popup )
$nPORT = 8092 $IP1 = GetIP() ;IP Adress is correct too; If $MainSocket = -1 Then While $MainSocket = -1 Or $MainSocket = 0 $MainSocket = TCPListen($IP1, $nPORT) If @error Then MsgBox(0, "", $IP1 & " port"& $nPORT &) $nPORT +=1 EndIf WEnd EndIf
Please help.
EDIT: Error in ip adress. I not use proxy and I don't know why my IP is different what I see on www.whatismyip.com

compare two files

$
0
0
Good evening, I need some advice.

Having to compare two files based on a common field, I wanted to ask for advice on the command more 'correct to use taking into account that the lengths of the files are never the same, they change every day.

thanks
Viewing all 12506 articles
Browse latest View live




Latest Images