Hi,
Has anyone got any advice for creating a script to work with the above msc or has an example script already?
Thnaks ina dvance for any suggestions/scripts.
Hi,
Has anyone got any advice for creating a script to work with the above msc or has an example script already?
Thnaks ina dvance for any suggestions/scripts.
Hi there!
I'm trying to delete old folders that are not in use anymore - the names of those folders are in a text file.
So what I want to do is have the script read the text file and compare the names in it to the actual folder names inside, and if the folder name from the list is found on the computer - delete it.
I am using filereadline to read from the text file, and _FileListToArrayRec to compare with the actual folders on the computer, but I need some help with the basic code. would appreciate the help..
#include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <file.au3> #Include <Date.au3> #include <Array.au3> ; ***** Create local logs DirCreate (@scriptdir & "test") $dir = (@scriptdir & "test"") $log = FileOpen (@scriptdir & "test"\test.log",2) ; Function for reading - text file Eof() Func Eof() ; Create a constant variable in Local scope of the filepath that will be read/written to. Global Const $sFilePath = @scriptdir & "\systems.txt" ; Open the file for reading and store the handle to a variable. Global $hFileOpen = FileOpen($sFilePath, $FO_READ) If $hFileOpen = -1 Then MsgBox($MB_SYSTEMMODAL, "", "An error occurred when reading the file.") Return False EndIf ; Read the contents of the file using the handle returned by FileOpen. Global $sFileRead = FileReadLine($hFileOpen, 1) ; Close the handle returned by FileOpen. ;FileClose($hFileOpen) ; Display the contents of the file. MsgBox($MB_SYSTEMMODAL, "", "Contents of the file:" & @CRLF & $sFileRead) EndFunc ; put the root in a variable $sRoot = (@ScriptDir) ; Retrieve a list of all the folders in $sRoot, and store them as an array in $aList Global $aList = _FileListToArrayRec ($sRoot, "*", 2, -2, 2) ; _FileListToArray("path" [, "Filter" [, Flag]]) ; Look at what _FileListToArray() puts into $aList _ArrayDisplay($aList) ; This is a loop that runs from 1 to the number of items listed in the first element of the returned array For $i = 1 To $aList[0] If $sFileRead = $sRoot & "\" & $aList[$i] Then _filewritelog ($log, "Deleting, " & $sFileRead) EndIf Next FileClose($hFileOpen)
Hi guy's I need help I can't get my script to loop the way I want
I have an app that has popup windows that I want to close with my script based on the window titles and tab through
the selection to close the windows down but I don't know how to repeat and make it loop the right way
here is my script I would like to make the ('Activation') loop until the ('User account') window pops up the go back to the top of the script again and wait for the ('Activation') windows to popup keep doing that until I end the script.
Can anyone help?
#RequireAdmin
While 1
WinWait ('Activation')
If WinActive ('Activation') Then
Send('{TAB}{TAB}{TAB}{SPACE}')
Sleep(60)
EndIf
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
If WinWait ('User account') Then
Send('{TAB}{TAB}{SPACE}{SPACE}')
Sleep(60)
Send('{TAB}{TAB}{TAB}{TAB}{SPACE}')
ElseIf WinWait ('Activation') Then
Send('{TAB}{TAB}{TAB}{SPACE}')
EndIf
WEnd
$MenuFile = GUICtrlCreateMenu("File") $MenuGenerateFiles = GUICtrlCreateMenuItem("Generate", $MenuFile) $MenuExportTemplate = GUICtrlCreateMenuItem("Export Data", $MenuGenerateFiles) GUICtrlCreateMenuItem("", $MenuGenerateFiles) ; Create a separator line $ExitMenu = GUICtrlCreateMenuItem("Exit", $MenuFile)
Hi all,
How to find first and last word in a sentence with Regular expression ?. Sentence is the code from SciTE. For example if sentence is;
"For $i = 0 to 15"
I need to extract "For from the sentence
And the same way i need last word from a sentence
"If Apple = 15 Then"
I need "Then" from the sentence.
Are this code stupid or am i stupid for don't see the error hahaha
Sorry i'm noob as a Autoit programmer
Hello all,
For some strange reason #AutoIt3Wrapper_run_debug_mode=Y is only working in some of my scripts... Reinstalled both Autoit and Scite4autoit3 but it's still not working yet it used to work some time ago.
The script that doesn't work gives me this output (after this output it continues running the script without debug):
>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "G:\LSD Scripts\LSD Scripts 1\LSD Scripts 1.au3" /UserParams +>14:41:41 Starting AutoIt3Wrapper v.14.801.2025.0 SciTE v.3.4.4.0 Keyboard:00000409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X86 Environment(Language:0413) +> SciTEDir => C:\Program Files\AutoIt3\SciTE UserDir => C:\Users\kamps495\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\kamps495\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.12.0) from:C:\Program Files\AutoIt3 input:G:\LSD Scripts\LSD Scripts 1\LSD Scripts 1.au3 +>14:41:41 AU3Check ended.rc:0 >Running:(3.3.12.0):C:\Program Files\AutoIt3\autoit3.exe "G:\LSD Scripts\LSD Scripts 1\LSD Scripts 1.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop !> Starting in DebugMode.. Line: @error-@extended: Line syntax +>14:41:43 AutoIt3.exe ended.rc:0 +>14:41:43 AutoIt3Wrapper Finished. >Exit code: 0 Time: 1.807
Another script (same Scite, different tab) gives me this:
>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "G:\LSD Scripts\Mousemover\mousemover.au3" /UserParams +>14:48:14 Starting AutoIt3Wrapper v.14.801.2025.0 SciTE v.3.4.4.0 Keyboard:00000409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X86 Environment(Language:0413) +> SciTEDir => C:\Program Files\AutoIt3\SciTE UserDir => C:\Users\kamps495\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\kamps495\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.12.0) from:C:\Program Files\AutoIt3 input:G:\LSD Scripts\Mousemover\mousemover.au3 +>14:48:15 AU3Check ended.rc:0 >Running:(3.3.12.0):C:\Program Files\AutoIt3\autoit3.exe "G:\LSD Scripts\Mousemover\mousemover.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop !> Starting in DebugMode.. Line: @error-@extended: Line syntax 0001: 0-0: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** 0002: 0-0: #AutoIt3Wrapper_run_debug_mode=Y ;y = debug aan, n = debug uit 0003: 0-0: #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** 0004: 0-0: Opt("WinWaitDelay", 1000)
and gives me line-by-line debug. Both have the same directives at the top:
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_run_debug_mode=Y ;y = debug aan, n = debug uit #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
I can't figure it out for the life of me...
EDIT:
It seems that adding #RequireAdmin ANYWHERE near the beginning of the script (before or after the #Region-part) breaks the debug. I really need #RequireAdmin (without it Internet Explorer crashes on me), but I cannot debug. When adding #RequireAdmin I can run my script, but I cannot debug it...
I checked all helpfile usually there is reference to:
https://www.autoitscript.com/autoit3/docs/functions/FileFindFirstFile.htm
But I do not find any description how to use "multiple wildcards".
I was trying with out success.
Anybody can help ?
mLipok
EDIT:
I know there have been numerous posts about this issue and that to solve the problem I should try an open the frame being referenced in a new IE window but this is not possible and would break the script (I need access to all frames at the same time).
However I was wondering why my code works flawlessly on windows 7, but on windows 8 and windows 10 preview it gives the access denied.
To give a little insight as to what I am doing, I am scripting outlook webmail so that I can click a button to forward a mail and append a subject to the subject line. This script is working 100% on windows 7 and like I said giving an access denied when I try to read info from a frame on windows 8 and 10. see some example code below for where the access denied is being thrown.
What settings can I change to fix the issue. I turned off XSS and I have tried numerous other settings changes to no avail. A few months ago this script was working fine in windows 8. Im wondering if there was an update than changed access to IE. Any help would be appreciated
Hi everybody,
I'm currently working on a script for sending files to a remote server by using the HTTP post method.
It's not my fav. way of sending files, but the remote party only supports this method.
So be it.
After digging through many examples over the net, I've managed to create a script that seems to do the trick.
There is one issue with my approach.
When I'm checking the returned @extended value from _WinHttpWriteData it always returns 0, despite a 200 OK status code from the remote site.
How come, what am I doing wrong here.
The script runs against a public httppost test server, so if needed you can run the script as well.
Thanks for your time.
#include <WinHttp.au3> SendFile("a_text_file.txt") SendFile("another_text_file.txt") Local $iBytesWritten Local $sResponseHeader Local $sResponseData Local $hSession Local $hConnect Local $hRequest ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ; 1) Create/Open a session handle ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ;Depending on using a proxy we use the appropriate function call $hSession = _WinHttpOpen($sUserAgent,$WINHTTP_ACCESS_TYPE_NAMED_PROXY,$sProxyIP & ":" & $sProxyPort,$WINHTTP_NO_PROXY_BYPASS,0) $hSession = _WinHttpOpen($sUserAgent, $WINHTTP_ACCESS_TYPE_NO_PROXY,$WINHTTP_NO_PROXY_NAME,$WINHTTP_NO_PROXY_BYPASS,0) ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ; 2) Create/Open connection handle ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ; Are we using HTTP or HTTPS? ConsoleWrite("Step 2) Executing function _WinHttpConnect(" & $hSession & "," & $sURLPrefix & $sHostName & $sUrlSuffix & "," & $INTERNET_DEFAULT_HTTPS_PORT & ") " & @CRLF) Else ; HTTP ConsoleWrite("Step 2) Executing function _WinHttpConnect(" & $hSession & "," & $sURLPrefix & $sHostName & $sUrlSuffix & "," & $INTERNET_DEFAULT_HTTP_PORT & ") " & @CRLF) ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ; 3a) Create/Open a request handle ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ; Are we using HTTP or HTTPS? ConsoleWrite("Step 3a) Executing funcion: _WinHttpOpenRequest(" & $hConnect & "," & $sMethod & "," & $sUrlSuffix & $sPHP_Script & $sPHP_Param & "," & $sHttpVersion & "," & $WINHTTP_NO_REFERER & ",*/*," & $WINHTTP_FLAG_SECURE & ")" & @CRLF) Else ; HTTP ConsoleWrite("Step 3a) Executing funcion: _WinHttpOpenRequest(" & $hConnect & "," & $sMethod & "," & $sUrlSuffix & $sPHP_Script & $sPHP_Param & "," & $sHttpVersion & "," & $WINHTTP_NO_REFERER & ",*/*," & Default & ")" & @CRLF) ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ; 3b)Pass credentionals before sending a request ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- _WinHttpSetCredentials($hRequest, $WINHTTP_AUTH_TARGET_SERVER, $WINHTTP_AUTH_SCHEME_BASIC, $sUserName,$sUserPass) ConsoleWrite("Step 3b) Executing funcion: _WinHttpSetCredentials(" & $hRequest & "," & $WINHTTP_AUTH_TARGET_SERVER & "," & $WINHTTP_AUTH_SCHEME_BASIC & "," & $sUserName & "," & $sUserPass & ")" & @CRLF) ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ; 3c)Send the request ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ConsoleWrite("Step 3c) Executing funcion: _WinHttpSendRequest(" & $hRequest & "," & $WINHTTP_NO_ADDITIONAL_HEADERS & "," & $WINHTTP_NO_REQUEST_DATA & ",0,0)" & @CRLF) ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ; 3d) End the request ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- _WinHttpReceiveResponse($hRequest) $sResponseHeader = _WinHttpQueryHeaders($hRequest) $iStatusCode = _WinHttpQueryHeaders($hRequest,$WINHTTP_QUERY_STATUS_CODE) ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ; 4) Send the next request ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ConsoleWrite("Step 4) Executing function _WinHttpSendRequest(" & $hRequest & "," & $WINHTTP_NO_ADDITIONAL_HEADERS & "," & $sFileData & "," & $iFileLen & ",Default)" & @CRLF) ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ; 5) Write data to server ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- _WinHttpWriteData($hRequest,$sFileData,0) ;Success - Returns 1 ;- @extended receives the number of bytes written. ;Despite a successful post, @extended remains 0 ;Why?????? ConsoleWrite("Step 5) Executing function _WinHttpWriteData(" & $hRequest & "," & $sFileData & ",0)" & @CRLF) ConsoleWrite("Step 5) File " & $sFolder & $sFileName & " succesfully send to " & $sHostName & " Total bytes written: " & $iBytesWritten & @CRLF) ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ; 6) End the request ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- _WinHttpReceiveResponse($hRequest) ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ; 7) Show response from server ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- $sResponseHeader = _WinHttpQueryHeaders($hRequest) $iStatusCode = _WinHttpQueryHeaders($hRequest,$WINHTTP_QUERY_STATUS_CODE) ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ; 8) Close handles ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- _winHttpCloseHandle($hRequest) _winHttpCloseHandle($hConnect) _winHttpCloseHandle($hSession)
Hi,
I am trying to add in code to existing code from the autoit recorder (the autoit recorder codes works fine). I am just not sure how to incorporate my If $Model statement in properly. Should that be part of the AU3RecordSetup() or should I have a separate function like DetectLaptop() ? I added that new function below. Just trying to confirm I am going down the right path with this or if I am way off base.
#region --- Au3Recorder generated code Start (v3.3.9.5 KeyboardLayout=00000409) --- #region --- Internal functions Au3Recorder Start --- #include <Process.au3> #include <WindowsConstants.au3> #include <File.au3> #include <Constants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> Dim $Model $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $colItems = "" $StrComputer = "localhost" Func _DetectLaptop() If $Model = "HP EliteBook 2530p" Or $Model = "HP EliteBook 2540p" Or $Model = "HP EliteBook 2560p" Or $Model = "HP EliteBook 2570p" Or $Model = "HP Compaq 6530b (FG996AW#ABA)" Or $Model = "HP ProBook 6455b" Or $Model = "HP ProBook 6465b" Or $Model = "HP ProBook 6475b" Or $Model = "HP EliteBook Folio 9470m" Or $Model = "HP ProBook 645 G1" Or $Model = "HP EliteBook Folio 9480m" Then ; Not a laptop or system not supported, do nothing _Au3RecordSetup() EndIf EndFunc Func _Au3RecordSetup() Opt('WinWaitDelay',100) Opt('WinDetectHiddenText',1) Opt('MouseCoordMode',0) Local $aResult = DllCall('User32.dll', 'int', 'GetKeyboardLayoutNameW', 'wstr', '') If $aResult[1] <> '00000409' Then MsgBox(64, 'Warning', 'Recording has been done under a different Keyboard layout' & @CRLF & '(00000409->' & $aResult[1] & ')') EndIf EndFunc Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc _AU3RecordSetup() #endregion --- Internal functions Au3Recorder End --- Run('C:\Program Files (x86)\Hewlett-Packard\HP Connection Manager\HPConnectionManager.exe') _WinWaitActivate("HP Connection Manager","") Send("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{ENTER}") _WinWaitActivate("Preferences","") Send("{TAB}{TAB}{DOWN}{TAB}{TAB}{SPACE}{TAB}{SPACE}{TAB}{SPACE}{TAB}{SPACE}{TAB}{ENTER}") ;Send("{TAB}{TAB}{DOWN}{TAB}{TAB}{SPACE}{TAB}{SPACE}{TAB}{SPACE}{TAB}{SPACE}{TAB}{SPACE}{TAB}{ENTER}") _WinWaitActivate("HP Connection Manager","") Send("{ALTDOWN}{F4}{ALTUP}{TAB}{ENTER}") #endregion --- Au3Recorder generated code End --- sleep (10000) _Win32_ComputerSystem() ;Get Model Func _Win32_ComputerSystem() ;Get General PC Info $objWMIService = ObjGet("winmgmts:\\" & $StrComputer & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) Then For $objItem In $colItems ;$DOMAIN = $objItem.Domain $Manufacturer = $objItem.Manufacturer $Model = $objItem.Model ;$MachineName = $objItem.Name ;$NumberOfProcessors = $objItem.NumberOfProcessors ;$PartOfDomain = $objItem.PartOfDomain ;$MEM = Round($objItem.TotalPhysicalMemory / 1024 / 1024, 0) Next EndIf EndFunc ;==>_Win32_ComputerSystem _SelfDelete() Func _SelfDelete($iDelay = 0) Local $sCmdFile FileDelete(@TempDir & "\scratch.bat") $sCmdFile = 'ping -n ' & $iDelay & '127.0.0.1 > nul' & @CRLF _ & ':loop' & @CRLF _ & 'del "' & @ScriptFullPath & '"' & @CRLF _ & 'if exist "' & @ScriptFullPath & '" goto loop' & @CRLF _ & 'del ' & @TempDir & '\scratch.bat' FileWrite(@TempDir & "\scratch.bat", $sCmdFile) Run(@TempDir & "\scratch.bat", @TempDir, @SW_HIDE) EndFunc
Hi, i have a problem with the Hotkeyset function, when i use it the CTRL get stuck.
not just in the window i use the script but also in every other window get to after that.
Below you find my script and i hope you guys can point me in the right direction.
I'm trying to adapt this:
GUIRegisterMsg($WM_LBUTTONDBLCLK, "_WM_LBUTTONDBLCLK") Local $fDblClk = False Local $iDoubleClickTime = 200 ; _WinAPI_GetDoubleClickTime() ; 500 by default Func _WM_LBUTTONDBLCLK($hWnd, $iMsg, $iwParam, $ilParam) Local $iX = BitAND($ilParam, 0xFFFF), $iY = BitShift($ilParam, 16) $fDblClk = True ConsoleWrite("!Double click on: [" & $iX & "," & $iY & "]" & @CRLF) Return $GUI_RUNDEFMSG EndFunc
To work on my List view. I already have a button called $Edit_Btn and I want to make it so when I doubleclick in the list view, it triggers the Edit_Btn case.
The code above seems to print out where I clicked on the console, but only when I click on the GUI background and not on the list view. Is there a easier way to make it so when I double click in a list view, it triggers the edit button?
Hi all,
I have a Problem with my script and I am new to AutoIt. What I want:
1. go to excel
2. copy a cell
3. go to my program
4. TAB 26 times to an specific field
5. paste the cell
6. go to Excel and to the next cell
7. start again
/Code in the End/
So it is all working, but sometimes my Script or PC or whatever is jumping only 25 times. Sometimes it doesn´t jump at all.
It is not all the time. Sometimes after 10 loots the jumps are wrong, sometimes after 160 , sometime everything goes well. So I have no idea how to figer it out. And what can couse this.
Something with Thread/Memory management or other Prozesses or just someting wrong in the script that couse it to crush sometimes.
I can not cominiicate with my program, so i can´t ask for field IDs or something like that.
Also mouse is not recomended.
For wrong jumps and errors I am using Pixel CheckSums.
1. left, right, over and under the filed I want to paste someting in.
Maybe this is breaking the code in the rumetime ?
So here is my Script:
sleepTime100() ;Funktions for the Pixel Check Sums ;Checkt für ungültiges Kammando MsgBox($MB_SYSTEMMODAL, "", "Ungültige Änderung! Ungültige Eingaben, SICLID bleibt hängen --> Fehler") ;Go to Excel sleepTime20() ;Copy active cell sleepTime20() ;Go to my Program sleepTime20() ;Safe the checksums ;my jump funktion jumpToUnion() ;HERE SOMETHING GOES WRONG DONT KNOW WHAT ;Paste the cell sleepTime100() ;new checksum for trying to jump out of the current page ;use my check funktions checkPixelUpDown() checkPixelWrongAction() checkPixelUnion() sleepTime20() checkPixelNextPage() ;Back to excel ;Go 1 cell down Next ;start the loop again
Thanks a lot for your time
Niksan
Hi all,
I have some lines of code which may leads to an error some times. So i need to put that code in a "Try.. Catch" block. But i couldn't find any keywords from help file. What is the equivalent of "Try..Catch" in AutoIt ?
hey guys I don't understand what Global - Local - Dim do for example here
#include <Constants.au3> ; only required for MsgBox constants
Global $Var_1 = "Variable 1"
Global $Var_2 = "Variable 2"
; Read the variables
MsgBox($MB_ICONINFORMATION + $MB_TOPMOST, "Reading", "In The Main Script" & @CRLF & @CRLF & "Variable 1 = " & $Var_1 & @CRLF & "Variable 2 = " & $Var_2)
; Read the variables in a function
_Function()
; And now read the variables again - see that $iVar_2 has changed
MsgBox($MB_ICONINFORMATION + $MB_TOPMOST, "Reading", "Back In The Main Script" & @CRLF & @CRLF & "Variable 1 = " & $Var_1 & @CRLF & "Variable 2 = " & $Var_2)
Func _Function()
; Read the variables
MsgBox($MB_ICONINFORMATION + $MB_TOPMOST, "Reading", "In The Function" & @CRLF & @CRLF & "Variable 1 = " & $Var_1 & @CRLF & "Variable 2 = " & $Var_2)
; Now let us change one of the variables WITHIN the function
$Var_2 = "Changed Variable 2"
EndFunc
I have copied it and used it works fine then I removed " Global " and still it works fine same as before nothing changes so what does global do hope someone will explain what they do exactly and sorry for bad english thank you.
I just finished reading the FAQ regarding:
Why doesn't my script work on a locked workstation?One thing that I didn't see mentioned was to run the AUTOIT on a separate machine (either real or virtual) and RDP into the second machine.
One can achieve security in such a setup by locking the local machine while AUTOIT continues to run on the remote machine.
The remote machine doesn't seem to lock if AUTOIT is doing sends and mouse moves.
Phil
Hello
I recently got a new PC at work and a script I created years ago stopped working. Specifically the script seems unable to find an open window using:
If WinExists("[REGEXPTITLE:(?i).*Processing.*?]") Then Local $hWnd1 = WinGetHandle("[REGEXPTITLE:(?i).*Processing.*?]") WinWaitNotActive($hWnd1, "",150) EndIf
The program I'm monitoring is running 3 reports for me. I don't want to sit here and run and export them myself 3x a day everyday, so this script was written to handle it for me. When I moved to the Win7 PC I just copied my script and downloaded the latest version of AutoIT. I'm running this directly from the editor. Here's most of the code to wait on the processing windows to close and then perform a mouse click to export the report:
Sleep(500) ;give the first "Processing..." window time to pop up Local $hWnd1 = WinGetHandle("[REGEXPTITLE:(?i).*Processing.*?]") WinWaitNotActive($hWnd1, "",150) ; Timeout after 150 seconds - since that would mean there is an issue $hWnd1 = 0 ; reset window handle for next processing window If WinExists("[REGEXPTITLE:(?i).*Processing.*?]") Then Local $hWnd1 = WinGetHandle("[REGEXPTITLE:(?i).*Processing.*?]") WinWaitNotActive($hWnd1, "",150) EndIf $hWnd1 = 0 If WinExists("[REGEXPTITLE:(?i).*Processing.*?]") Then Local $hWnd1 = WinGetHandle("[REGEXPTITLE:(?i).*Processing.*?]") WinWaitNotActive($hWnd1, "",150) EndIf $hWnd1 = 0 If WinExists("[REGEXPTITLE:(?i).*Processing.*?]") Then Local $hWnd1 = WinGetHandle("[REGEXPTITLE:(?i).*Processing.*?]") WinWaitNotActive($hWnd1, "",150) EndIf Sleep(2000) MouseClick("right", 280, 174, 1, 20) Send("{DOWN 3}") Sleep(2000) Send("{RIGHT}") Sleep(2000) Send("{ENTER}") Sleep(2000) Send("{ESC}") Sleep(2000) ;all done
I'm using Opt("WinTitleMatchMode", 1).
I can find the window just fine when I'm not using WinExists(). Why doesn't this work after the PC upgrade and how do I fix it?
Thanks for any help!
Hello, I want to make autoit with facebook login with winhttp. Without using IE. Winhttp or is there another way?
I have a script that has 5 inputs
these inputs are filled with number from 1 to 5
so:
input1 = 1
input2 = 2
input3 = 3
input4 = 4
input3 = 5
but I want it to shuffle the numbers like:
input1 = 4
input2 = 1
input3 = 5
input4 = 2
input5= 3
I dont want to use the Random function because then there is a possibilty It will chose number with the same value, I need a number from 1 to 5 to be shown but in different order