Jump to content

Search the Community

Showing results for tags 'autoit'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office


  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office


  • Forum
  • AutoIt


  • Community Calendar

Found 572 results

  1. I have a script which executes sleep for a couple of hours then carries out instructions. Does the running AutoIt script prevent the computer from entering sleep mode during this time? If not, is there something I can add to the AutoIt script to keep the computer awake? Grateful for advice.
  2. Hi, I have a program that is read data from the .txt file, since the .txt file is only readable, viewable and editable for the admin user. But how could I lock it with password, or some other technique that can helps to achieve this? Thanks for the advanced information.
  3. Hi, How can I the trigger the another button functions without waiting the previous function to finish execute? Any advise? I couldn't find any relevant topics via google. Thanks a lot.
  4. Hi all, I need to use ControlMove() on some controls of a hidden GUI window. This works properly on a GUI window created with default style, but does not work on a GUI window created with style $WS_OVERLAPPEDWINDOW func GUItest($bOverlapped) $m = GUICreate("test", 200, 100, -1, -1, $bOverlapped ? $WS_OVERLAPPEDWINDOW : -1) $g = GUICtrlCreateButton("test", 0, 0) ControlMove($m, "", $g, 30, 30) GUISetState() endfunc GuiTest(false) ; button 'test' properly moved to (30,30) GuiTest(true) ; button 'test' not moved and still sitting at (0,0) Any reason for this unexpected behavior ? Any workaround to fix this ? Thanks for any help
  5. Hi all.. I'm having slight issue that has be a bit puzzled. I have an Input control.. After a certain function runs, it Disables that Input control, and sets it to ReadOnly. When running another certain function, it re-Enables that Input control, and sets the style back to Default. Which does work, however, when typing into the Input control after re-Enabling it, the text appears as a light gray color, rather than its original black color. I'm sure there's a simple solution here.. But what that is, appears to be beyond me. Here is a simplified example code: #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= Global $Form1 = GUICreate("Form1", 245, 215, 192, 124) Global $disableBTN = GUICtrlCreateButton("Disable", 32, 64, 75, 25) Global $enableBTN = GUICtrlCreateButton("Enable", 128, 64, 75, 25) Global $Input1 = GUICtrlCreateInput("", 32, 120, 169, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $disableBTN disable() Case $enableBTN enable() EndSwitch WEnd Func disable() GUICtrlSetState($Input1, $GUI_DISABLE) GUICtrlSetStyle($Input1, $ES_READONLY) EndFunc Func enable() GUICtrlSetState($Input1, $GUI_ENABLE) GUICtrlSetStyle($Input1, $GUI_SS_DEFAULT_INPUT) EndFunc Any help would be greatly appreciated Thank you in advance!
  6. Hi all, I'm trying to create a script that runs a JSON-query and then can retrieve some variables out of the returned, decoded object using JSON.au3. I have tried some other examples on this forum, but I'm stuck at one point. My query works perfectly and gets loaded into the variable $data. Then, decoding $data to $object seems to work as well. But then I can't get the date-field out of this JSON-structure with my script. The JSON-structure returned looks like this: { "content": [ { "id": "451ec583-8f27-4926-82a3-a2d85e57a110", "createdDate": "2018-08-08T08:40:57.449004Z", "updatedDate": "2018-08-08T08:40:57.449004Z", "lastOpenedDate": "2018-08-08T08:40:57.449004Z", "date": "2018-04-26T00:00:00", "description": "X-Ray Exam", "patient": { "id": "f857238a-c75d-4760-b8d1-8f50f8f9bbfa", "createdDate": "2018-08-08T08:40:37.623976Z", "updatedDate": "2018-08-08T08:40:37.623976Z", "lastOpenedDate": "2018-08-08T08:40:37.623976Z", "name": "Fuerstonia", "birthDate": "2014-06-08", "breed": "", "chip": "", "color": "", "damsire": "", "sire": "", "neutered": false, "orthancUuid": "", "sex": "U", "species": "Paard", "ueln": "De 431310762114", "pmsReference": "", "origin": "" }, "type": "study", "accessionNumber": "KME201806960467", "instanceUid": null, "orthancUuid": "", "sent": false, "seriesCount": 0, "modalityType": "RX", "typeAndModality": "study RX", "client": { "id": "be627195-8458-4927-8446-f1ef37b917a4", "createdDate": "2018-08-08T08:40:31.433968Z", "updatedDate": "2018-08-08T08:40:31.433968Z", "lastOpenedDate": "2018-08-08T09:26:49.512298Z", "via": "", "extraInfo": "", "pmsReference": "", "contact": { "id": "406cc555-c491-4c29-b6bb-8d903f0e35a9", "createdDate": "2018-08-08T08:40:31.428968Z", "updatedDate": "2018-08-08T08:40:31.428968Z", "lastName": "Client 1", "firstName": "", "company": "", "email": "", "language": "nl", "phone": "", "address": { "id": "6fc7703c-137a-4e0a-ba96-8c7f38f2044b", "city": "", "country": "", "line": "", "postalCode": "" } } } }, My script looks like this: #RequireAdmin #include <json.au3> #include <inet.au3> #include <File.au3> ;Create a handle to a logfile (will be created if it doesnt exist) Global $logfile = FileOpen("C:\VSOL\VSTK\Logs\MigrationFix\MigrationFix.log",9) FileWriteLine($logfile,"Start script") ;Create the URL with the JSON-query $URL = "http://localhost:8080/v0/studies/?seriesCount=1" ;Catch the query output into a variable $data = _INetGetSource($URL) ;Check if there is any data at all in this variable, if not, exit If Not $data Then MsgBox(1,"Error","No answer. Server is probably not running.") Exit EndIf ;For debugging purposes FileWriteLine($logfile,$data) ;Decode the JSON_string into a useable object $object = Json_Decode($data,1000) If @error Then FileWriteLine($logfile,"Error decoding JSON") Exit EndIf Local $i = 0 ;Start a loop to retrieve the study date of each study... While 1 $study_date = json_get($object,'[' & $i & '].date') If @error Then FileWriteLine($logfile,"Study-Date retrieval error") ExitLoop EndIf $i = $i + 1 WEnd ;Close the logfile FileWriteLine($logfile,"Stop script") FileClose($logfile) ;Open the logfile for quick reference ShellExecute("C:\VSOL\VSTK\Logs\MigrationFix\MigrationFix.log") If believe it has something to do with my json_get($object...)-command. Anyone who can point me in the right direction? Thanks in advance! Kind regards
  7. Hi Guys, I was trying to read some data from the excel file and without opening the file. But I tried a lot of methods, it still open the file. And also, I am able to capture the ColumnA value but not Column B. Thanks for advance information. Global $oDataA, $oDataB Call ("ExcelRead", "B2", "C2") Func ExcelRead($oColumnA, $oColumnB) Local $oPath = @ScriptDir & "\MyFile.xlsx" Local $oExcel = _Excel_Open() Local $oWorkbook = _Excel_BookOpen($oExcel, $oPath, 1, 0) $oDataA = _Excel_RangeRead($oWorkbook, "Sheet 1", $oColumnA) $oDataB = _Excel_RangeRead($oWorkbook, "Sheet 1", $oColumnB) MsgBox(0, "Test Value", $oDataA & ", " & $oDataB) EndFunc
  8. I have an array of subarrays, eg: local $a[3] = [ 1, 2, 3 ] local $b[3] = [ 4, 5, 6 ] local $c[2] = [ $a, $b ] I can read read a subarray element of the array, as follows: local $c12 = ($c[1])[2] ; result: $c12 = 6 However, when I try to set a subarray element as follows, it fails: ($c[1])[2] = 12 ; this fails to set subarray element local $c12 = ($c[1])[2] ; result: $c12 = 6 How to set a subarray element ? Thanks
  9. Good morning everyone, I thought I had already solved this issue but it turns out I did not. My code finds unread emails with this specific subject line of "request" but when I change the subject to SKIPPED + "request" = ("SKIPPED request") the program still finds the email and tries to process it. I only want to process emails with the exact match subject of "request". Here is my code that "finds" the unread emails with the subject of "request" or so I thought. Func ListUnreadEmails() ;******************************************************************************* ; Lists all unread E-mails from the folder Outlook-UDF-Test ;******************************************************************************* ; Stores all the unRead emails into an array Global $aItems = _OL_ItemFind($oOutlook, "*\Outlook-UDF-Test", $olMail, _ "[UnRead]=True", "Subject", "request", "EntryID,Subject", "", 1) ; Displays the array of unRead emails If IsArray($aItems) Then ;_ArrayDisplay($aItems, "OutlookEX UDF: _OL_ItemFind - Unread mails") Else MsgBox(48, "OutlookEX UDF: _OL_ItemFind Example Script", _ "Could not find an unread mail. @error = " & @error & ", @extended: " & @extended) EndIf ; Gets the number of unread emails Global $numberOfUnRead = UBound($aItems, $UBOUND_ROWS) - 1 ;MsgBox("", "Number of Unread emails", $numberOfUnRead) EndFunc It acts as if any part of the subject containing the word "request" and the email is unread that it will try to process it. (I think)
  10. Hi, I need to automate Java application using AutoIt, I have refer forum for the same, as per forum I am using Java Access Bridge to finding control name. But could not set value to control. Below is my sample code Send("#r") sleep(1500) Send("D:\javaapplication\javaapplication\Hello.jar{Enter}") WinActivate("Penjumlahan") sleep(1500) ControlSetText("Penjumlahan", "", "Name: A :", "demo") Java Application and Java Ferret screen
  11. Hello, May i know how can i automation qt application? Using controlclick not mouse and positions Thanks
  12. Good afternoon, I am in need of some help. I am sure this is a stupid question requiring only one or two lines of code. However, I would greatly appreciate the help I cannot figure this out. I also tried searching for the answer on the internet but no one except me apparently seems to be having a hard time figuring this out and or is asking about it. I simply want to change the "status" of an email from unread to read once I have processed it. My code is over 500 lines and I would like not to clutter this post with it. Assume I have all my includes and connections properly defined and stuff. Here is the bit of code where I am trying to change the email that was used from unread to read: Func ChangeEmailStatus() ;******************************************************************************* ; changes the status of an email from unread to Read ;******************************************************************************* Local $iRows = UBound($aItems, $UBOUND_ROWS) MsgBox("", "Number of Unread emails (Before Change)", $iRows) _OL_ItemModify($oOutlook,$aItems[$i][0], Default, "Read=True") MsgBox("", "Array Display 1", $aItems[1][0]) MsgBox("", "Array Display 2", $aItems[2][0]) Local $iRows = UBound($aItems, $UBOUND_ROWS) MsgBox("", "Number of Unread emails (After Change)", $iRows) EndFunc
  13. Hello, Is there any way to check for validity of a pointer to a DllStruct ? In the above code, a DllStruct is created from an invalid pointer. How to prevent from doing this ? local $tStruct = DllStructCreate("int i") DllStructSetData($tStruct, "i", 123) local $pStruct = DllStructGetPtr($tStruct) $tStruct = 0 ; destroy DllStruct ==> $pStruct becomes invalid ; how to check here for validity of $pStruct and prevent from doing the following ? $tStruct = DllStructCreate("int i", $pStruct) ; create DllStruct from invalid pointer... MsgBox(0, @ScriptName, @error) ; displays '0' : invalid pointer is not detected by DllStructCreate() MsgBox(0, @ScriptName, IsDllStruct($tStruct)) ; displays '1' : tStruct is assumed as a valid DllStruct object, which is not Thanks for help
  14. i want am trying to select a nimber to run a program and then select where to save the excel result at before hand the problem is that it does not save in the folder i want but the folder before any solutions #................. $sFolder = "" ; Create a constant variable in Local scope of the message to display in FileSelectFolder. Local Const $sMessage = "Select a folder" ; Display an open dialog to select a file. $sFileSelectFolder = FileSelectFolder($sMessage, $sFolder) If @error Then ; Display the error message. MsgBox($MB_SYSTEMMODAL, "", "No folder was selected.") Else ; Display the selected folder. MsgBox($MB_SYSTEMMODAL, "", "You chose the following folder:" & @CRLF & $sFileSelectFolder) EndIf ....... ........ $oExcel = ObjCreate("Excel.Application") ; Create an Excel Object $oExcel.Visible = 1 ; Let Excel show itself $oExcel.Workbooks.Open("J:\OPS\OPS_Share\Planners\2 - Weekly Reports\Auto download\"& $YY & $MM & $DD & " ORDER.xls",0) $oExcel.ActiveWorkbook.Saveas ( $sFileSelectFolder,""& $YY & $MM & $DD & " ORDER.xlsx", 1) $oExcel.ActiveWorkBook.Close $oExcel.Quit i only want to save it as ddmmyy order inside documents but it saves in libraries as documents ddmmyy order.
  15. I am trying to make a simple installer script for my understanding. I would just like to understand how to deal with multiple possible windows. In the case of installing VLC, I might get a window saying VLC is already installed. I have also tried a switch with no luck. I would just like to understand some methods for dealing with the possible existence of unexpected windows. ;INSTALL VLC VIEWER Run(@ScriptDir & '\bin\VLCViewer_2.2.4_3.EXE') AutoItSetOption('MouseCoordMode', 0) sleep(4000) WinWait("VLC Viewer 2.2.4") ; this window will pop up if vlc is already installed If WinExists( "VLC Viewer 2.2.4", "VLC 2.2.4 Already Installed") Then ConsoleWrite ("already installed") WinActivate ('VLC Viewer 2.2.4','Already Installed') MouseClick ('primary', 93, 83, 1, 0) EndIf ; this window will pop up if installer finishes sucessfully If WinExists( "VLC Viewer 2.2.4", "VLC Viewer 2.2.4 Installed") Then ConsoleWrite ("already installed") WinActivate ('VLC Viewer 2.2.4','VlC Installed') MouseClick ('primary', 93, 83, 1, 0) EndIf
  16. I need to send a string of text to this popup and click on the ok button to save it. Here is the code I have so far: ;Start IE Sleep(7000) $oIE = _IECreate("http://www.google.com") Sleep(500) _IELoadWait($oIE) $hIE = _IEPropertyGet($oIE, "hwnd") ; Get Handle of the IE window Sleep(500) WinSetState($hIE, "", @SW_MAXIMIZE) ;Wait for a browser page load to complete Sleep(3000) _IENavigate($oIE, "https://properURL.com") Sleep(8000) _IELoadWait($oIE) ;Attach to a browser control embedded in another window $oIE = _IEAttach("https://"properURL.com", url") ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $oIE = ' & $oIE & @CRLF & '>Error code: ' & @error & ' Extended code: 0x' & Hex(@extended) & @CRLF) ;### Debug Console Sleep(2000) ;Get the title of the webpage ;Local $wTitle = _IEPropertyGet($oIE, "title") ;MsgBox($MB_SYSTEMMODAL, "Webpage title:", $wTitle) ;Clicks the new button Sleep(3000) _IEAction($nWorkOrderB, "focus") _IEAction($nWorkOrderB, "click") Sleep(5000) ;Store the Element names where the important data will be sent ;Store the long description button Local $wLongDButton = _IEGetObjById($oIE, "m65d795a4-img") ;Store the long Description field id Local $wComments = _IEGetObjById($oIE, "ma6499a9c-rte_iframe") ;Store the ok button id that is in the long description Local $wCommOk = _IEGetObjById($oIE, "m74031266-pb") ;******************************************************************************* ; Send the stored data to the proper field ;******************************************************************************* ;Click the long description button Sleep(300) _IEAction($wLongDButton, "focus") _IEAction($wLongDButton, "click") Sleep(300) ;Sends the Comments Sleep(500) _IEAction($wComments, "focus") _IEAction($wComments, "click") Sleep(500) _IEFormElementSetValue($wComments, "hello darkness my old friend") ;Click the ok button Sleep(500) _IEAction($wCommOk, "focus") _IEAction($wCommOk, "click") Sleep(500) Here is the popup:
  17. After i create my GUI i cant set the color anymore. help? $hBarGUI1 = GUICreate("", 50, 1, 91, 188, 0x80000000, 0x08000080) $g = GUICtrlCreateLabel("", 1, 1, 1, 1) GUICtrlSetBkColor(-1, $color) GUISetBkColor($color, $hBarGUI1) WinSetTrans($hBarGUI1, '', 0) WinSetState($hBarGUI1, '', @SW_SHOWNOACTIVATE) WinMove($hBarGUI1, '', -1, -1) WinSetTrans($hBarGUI1, '', 254) WinSetOnTop($hBarGUI1, "", 1) I see that my problem has to do something with WinSetState but have no clue how to fix it already tried to set it to @SW_UNLOCK and @SW_SHOWNORMAL. @swa
  18. Hello again, I am in phase two of my help bot. I cannot figure out how to properly code Autoit to click on a webpage button using the I.E UDF. I want to click on the button that I have attached as an image. This button does not have a name but it has an ID. Here is the HTML code for this button that I found using chromes developer inspector. HTML Code: <img role="button" tabindex="-1" id="toolactions_INSERT-tbb_image" src="nav_icon_insertkey.gif" alt="New Work Order CTRL+ALT+I" draggable="false"> Here is the code that I have so far: ;******************************************************************************* ; Opens IE and fill out a New Workorder ;******************************************************************************* ; Start IE at the ** Tracking Application in ****** $oIE = _IECreate("https:I_am_Bound_by_my_company_to_not_reveal_this_webpage") ; Wait for a browser page load to complete _IELoadWait($oIE) Sleep(6000) ; Store the field names where the important data will be sent Local $nWorkOrderB = _IEGetObjById($oIE, "toolactions_INSERT-tbb_image") _IEAction($nWorkOrderB, "click") I want my program to click on the button that looks like a piece of paper with a blue # (For those wondering, I am allowed to send images just not the URL.) As always any help would be appreciated.
  19. How to click this button ? I Try func test () $oCorrectObj = "" $tags = $oIE.document.GetElementsByTagName("button") For $tag in $tags $class_value = $tag.GetAttribute("type") If string($class_value) = "buttont" Then $oCorrectObj = $tag MsgBox(0, "Level: ", "Level found :)") Else MsgBox(16, "Failed", "Not found.") ExitLoop EndIf Next If IsObj ( $oCorrectObj ) Then _IEAction ($oCorrectObj, "click") EndIF and func klik () Local $oFound = "" Local $oBtns = _IETagNameGetCollection($oIE, "span") For $oBtn In $oBtns If String($oBtn.classname) = "yt-uix-button-content" Then $oFound = $oBtn EndIf Next _IEAction ($oFound, "click") EndFunc Please Help Can you click it by name?
  20. Hello again everyone, I am trying to make a simple bot/AI to help me at work. I need it to read the subject line of emails, open them if a certain subject line is found, and then copy the contents of the said email and paste it in a different program. Can the Autoit outlook UDF help me achieve this? Also, I have tried the Outlook UDF and so far I have only figured out how to find all the unread emails (thanks to one of water's example scripts. @water you are a genius just saying). I am very new to this UDF and would love any help that would guide me into making this bot/AI a reality at work.
  21. I am using the following code to try to send an email through an autoit script. (I removed the variables for security reasons) #include <Inet.au3> Local $SmtpServer = "" Local $s_FromName = "" Local $s_FromAddress = "" Local $s_ToAddress = "" Local $s_Subject = "My Test UDF" Local $as_Body[2] $as_Body[0] = "Testing the new email udf" $as_Body[1] = "Second Line" Local $Response = _INetSmtpMail($SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, @ComputerName, -1) Local $err = @error If $Response = 1 Then MsgBox(0, "Success!", "Mail sent") Else MsgBox(0, "Error!", "Mail failed with error code " & $err) Endif I am getting a response that the email was sent successfully but am receiving nothing. Could it be a firewall issue? If so, how would I be able to tell?
  22. I am running the following code: DirRemove("C:\Desktop\Install.zip",1) I don't receive an error but the folder is not deleted. If i run this same script on a non zipped folder it works fine. Does DirRemove not work for zipped files? If not is there a way to delete them?
  23. Hi and Hello from a Noob..:-) i have a very weird problem. I fill up a 2d array with a)numbers and b)letters from A-Z, so 2 columns. This works absolutely perfect. But as soon as i try to sort them (numbers ascending) the array ends up in some kind of "String-sortation". What exactly am i doin wrong? To make it easy, i post below the piece of code, which i am talking about. Hope that someone can help me out. Func Analyse() Local $BasisArray[0] Local $aFill = "A" & "|B" & "|C" & "|D" & "|E" & "|F" & "|G" & "|H" & "|I" & "|J" & "|K" & "|L" & "|M" & "|N" & "|O" & "|P" & "|Q" & "|R" & "|S" & "|T" & "|U" & "|V" & "|W" & "|X" & "|Y" & "|Z" _ArrayAdd ($BasisArray, $afill) Local $FreqArray[0][2]=[[]] $row = 0 For $i = 0 to 25 $fummel = _ArrayToString ($BasisArray, ":" , $row, $row) $readout = _GUICtrlRichEdit_GetText ($hRichEdit) $anzAs = stringreplace ($readout, $fummel, $fummel) $extended = @extended $FreqFill = $extended & "|" & $fummel _ArrayAdd($FreqArray, $FreqFill) $row = $row + 1 Next _ArrayDisplay($FreqArray, "2D - Item delimited") _ArraySort($FreqArray) _ArrayDisplay($FreqArray, "bla") Thanks for helping me, Cheers, Patrick
  24. I am running an exe, that copies a seperate exe (test123.exe)from my computer and puts it onto a remote server "testserver". Everything works fine up to this point. I need to run this copied exe (test123.exe) on "testserver" but it keeps running on my computer instead. The code I am using to run the exe is below. What am I doing wrong? How can I get this executable to run on the remote server and not my home computer? RunWait( "\\testserver.domain.com\c$\user1\greichert\Desktop\InstallEXE\InstallEXE\test123.exe","\\testserver.domain.com\c$\Users\user1\Desktop\InstallEXE\InstallEXE");run exe
  25. I am trying to stop a windows service on a separate server than where my script is running. When I run the following script on the same server as the service I need to stop, it works fine. RunWait(@ComSpec & " /c net stop FascetAgentfv2", @ScriptDir, @SW_HIDE);stop agent But when I change "@ScriptDir" to ""\\newserver\c$\Program Files\test\" and run it on my server nothing happens. I tried to error handle and all it was returning was "2". Any suggestions?