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

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start






Found 613 results

  1. Have downloaded and installed AutoIt as well as ScITE and can run scripts with no issue in ScITE. Have also installed VSC (Visual Studio Code) and have installed Damien's extension for AutoIT. When trying to do various operations in VSC, I see: F5 = command 'extension.runScript' not found CTRL+F5 = command 'extension.check' not found CTRL+F6 = command 'extension.launchInfo' not found ALT+M = command 'extension.LaunchKoda' not found Thanks!
  2. Hello everyone, it has been a while since I have been involved in a serious AutoIt-related project discussion in the forums here, so it feels good to be back at it First a little backstory, a few months back (or a year ago) I made the switch to Linux from Windows... there were several reasons as to why I was motivated to do it, but the main things was Windows 10 was getting out of hand, it didn't offer enough freedom out of the box (restrictive settings, greedy defaults etc.) and had several issues with all kinds of software, many of them mysteriously hard to fix. I did have Linux installed as my secondary operating system for few years at that point and I began to see me regularly use it more than Windows, so one day I went ahead and said "fork it", I have stuck to Linux from that point on as my primary operating system. Windows is still installed in my computer and I also have a virtual machine with the latest version of Windows 10 on it, primarily because I still use Windows to write software using AutoIt as part of my job (freelance). I was pretty sad about the fact that I could no longer use AutoIt to make stuff for myself (since it doesn't run on Linux), I missed sharing code with the community here, this was a great hobby for me as AutoIt is what got me start with programming (even though I had tried several times to get into other languages before, those attempts were never as successful as what I have done in AutoIt). In Linux there is no language which is similar to AutoIt unfortunately, there are a few things which come close but are not on par with AutoIt's ease of use. As some of you may know, I have recently started working on other projects using the C language, it is a great step I have taken and I am learning a lot... but it is still not easy to create quick scripts or programs in C, due to the amount of configuration and dedication it takes to make a C program, also it is not ideal for sharing as multiple source files are involved. And on top of that you still have to deal with platform-specific APIs since C is a low-level language. (Getting back to core of this topic's subject) To solve this issue and to sharpen my programming skills, I could start working on an alternate cross-platform implementation of the AutoIt language which should be backwards compatible with the current AutoIt v3 on C The primary aim in the beginning is to implement all the basic functions (File, String, Numbers etc.) in AutoIt so that it is possible to make basic and fundamental scripts which would work in both Windows and Linux The main features would be: Cross-platform (Linux and Windows with the possibility supporting of Mac) Backward compatible with AutoIt 3 Byte-code based interpreter instead of source interpreter Easy to use (just like the current AutoIt) The advantage of having a byte-code based interpreter is that it makes the interpreter lighter and faster since it doesn't have to deal with parsing the source code, this would also open the door for some compile time optimizations... another bonus thing for those who don't like their source code present inside the compiler binaries is that it should be impossible to get hands on the original source code, this of course does not mean that decompilation can be stopped... it merely means that anyone decompiling would have to reconstruct the code from the byte-code. We can later on implement GUI related functions and maybe even automation related functions if the project gets enough traction I am adding a poll to keep track of people who are willing to invest in this project or would like to see it come into existence. Welcome any comments, suggestions etc. Obviously I will have a lot to learn and my work might interfere with this at times, but with enough interest I can see myself working on this to deliver a very basic prototype which could be used with basic scripts.
  3. Hey there, I have a program that I'm working on, and I have a button that's supposed to stop a running function, when it's pressed. However, I cannot get that to work. I put together a sample script that is set up in the same way: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= Opt("GUIOnEventMode", 1) Global $Form1 = GUICreate("Form1", 290, 106, 192, 124) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") Global $btnStart = GUICtrlCreateButton("Start", 24, 24, 99, 49) GUICtrlSetOnEvent($btnStart, "_Start") Global $btnStop = GUICtrlCreateButton("Stop", 152, 24, 99, 49) GUICtrlSetOnEvent($btnStop, "_Stop") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 ;~ $nMsg = GUIGetMsg() ;~ Switch $nMsg ;~ Case $GUI_EVENT_CLOSE ;~ Exit ;~ EndSwitch WEnd Func _Start() Global $bStartFlag = True $num = 1 While $bStartFlag ConsoleWrite($num & @CRLF) Sleep(1000) $num += 1 WEnd ConsoleWrite("Exited loop.." & @CRLF) EndFunc Func _Stop() Global $bStartFlag = False EndFunc Func _Exit() Exit EndFunc With the code above, while the _Start() func is running, the Stop button doesn't do anything. I even threw a MsgBox into the _Stop() func, to see if the script was at least accessing the _Stop() func. But that showed that the _Stop() func is not being accessed at all while the _Start() func is running. I'm sure this is a simple solution that I'm just over looking. But I can't figure out what that solution is lol. Any help here would be greatly appreciated! Thank you in advance!
  4. Hi all, I'm trying to write a script that connects with a VBA/COM API to get the status of a connected phone. I've been looking up and down this forum for tips or other user's experiences, but I can't seem to find anything (even remotely) similar. It shouldn't be so hard to do, however. Software I'm trying to connect to I'm trying to integrate CallCenter by using their API, which is documented over here : JustRemotePhone API Reference Things I've tried I've tried using ObjCreate but I don't get any result, it always returns the same (negative) error. #Version 1 tried ObjCreate("JustRemotePhone.RemotePhoneService") #Version 2 tried ObjCreate("JustRemotePhoneCOM.RemotePhoneService") #Version 3 tried ObjCreate("JustRemotePhoneCOM.RemotePhoneService.Application") None of the three versions I tried seem to deliver any result other than a negative error value which basically says that the given class is not valid. I am starting to get the hang of AutoIt by now, but unmanaged programming languages and object-oriented stuff is still quite a grey zone for me. If anyone could help me 'talk' to this application, I'd be immensely grateful! Thanks in advance and kind regards from Belgium! Jan
  5. Hello everyone, I am wondering if and how it is possible to connect my AutoIt script to a different email in my outlook. I have two different accounts when I open outlook. The first which my script always connects to is my own email while the second is a group email account. How or can I make the script connect to the second one and access its inbox instead of mine? This is all work related so no funny business here. Global $oOutlook = _OL_Open() ; Store all the Unread emails into an array Global $aItems = _OL_ItemFind($oOutlook, "*\Outlook-UDF-Test", $olMail, _ "[UnRead]=True", "Subject", "Maintenance Request from Eagle's Nest", "EntryID,Subject", "", 1) ; Display 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 ; Get the number of unread emails Global $numberOfUnRead = UBound($aItems, $UBOUND_ROWS) - 1 ;MsgBox("", "Number of Unread emails", $numberOfUnRead) ConsoleWrite("Number of unread emails: " & $numberOfUnRead & @CRLF) I might be missing some code in the post but my code works It's just so long I don't want to post all 2300+ lines. Thank you for the help I greatly appreciate this community.
  6. I have a macro that works well on 95% of computers. However, I am running into an issue on a couple computers where the _GUICtrlTreeView_ClickItem clicks the wrong item (an item or two below the correct one). Both the ExpandItem and SelectItem command work fine, just the click item is off on these computers (and only their user names). I'm not sure if some temp file somewhere is causing an issue or what. Note, using ONLY selectitem results in inconsistent focusing (item appears focused but the next command won't always work correctly). Hence my need to use the clickitem command. Any help would be appreciated. _GUICtrlTreeView_Expand($hWnd, $Array2[$i]) ;Expand $model Sleep(250) _GUICtrlTreeView_SelectItem($hWnd, $Array2[$i]) ;Select $model Sleep(150) _GUICtrlTreeView_ClickItem($hWnd, $Array2[$i]) ;Click $model Sleep(150) EndIf
  7. hello all, and welcome to this tool the NB-Password_generator is a small tool which allow you to create a strong passwords with this tool you can create a random passwords using : 1. capital letters 2. small letters 3. numbers 4. symbols be sure that you can check any option that you want and uncheck what you don't want to use this tool allow you to create a password from 6 letters to 150 lettersNB-Password_generator.zip at the end please accept my greetings am waiting for your commants
  8. Hello so i need help, so i have a while(1) Loop but i want to restart the loop form the begining if a specific event occurs or what i want on screen is occured.. i want to restart the loop from beginning , leaving the rest of the script. But if the event didnt occur it follows the rest of the script and goes on while loop..
  9. Hello , I've the following problem and hope somebody can push me in the right direction or have a good example on how to do it. The problem is :I want to search / select / change /check a XML setting in a XML file. The example XML file is as following : <Configuration> <Categories> <Category Name="default"> <SubCategories> <SubCategory Name="defaultsettings"> <Settings> <Setting Name="machinename" TypeName="System.String" Value="defaultname" /> <Setting Name="cpuspeed" TypeName="System.String" Value="false" /> <Setting Name="cmptemp" TypeName="System.String" Value="false" /> <Setting Name="cmpspeed_set" TypeName="System.String" Value="" /> <Setting Name="cmptemp_set" TypeName="System.String" Value="" /> </Settings> </SubCategory> </SubCategories> </Category> <Category Name="settings"> <SubCategories> <SubCategory Name="comp1"> <Settings> <Setting Name="machinename" TypeName="System.String" Value="comp1" /> <Setting Name="cpuspeed" TypeName="System.String" Value="true" /> <Setting Name="cmptemp" TypeName="System.String" Value="false" /> <Setting Name="cmpspeed_set" TypeName="System.String" Value="12" /> <Setting Name="cmptemp_set" TypeName="System.String" Value="" /> </Settings> </SubCategory> <SubCategory Name="comp2"> <Settings> <Setting Name="machinename" TypeName="System.String" Value="comp2" /> <Setting Name="cpuspeed" TypeName="System.String" Value="false" /> <Setting Name="cmptemp" TypeName="System.String" Value="true" /> <Setting Name="cmpspeed_set" TypeName="System.String" Value="" /> <Setting Name="cmptemp_set" TypeName="System.String" Value="9" /> </Settings> </SubCategory> </SubCategories> </Category> </Categories> </Configuration> In this XML file I want to : -search if subcategory whit the name "comp3" exists -if exist change of setting "cpuspeed" value to false -if not exist make a new subcategory "comp3" whit the default settings from subcategory "default settings" what i have this far is : Func xml_test1() Dim $return[0] Local $file = @ScriptDir & "\test.xml" FileOpen($file, $FO_READ) _FileReadToArray($file,$return) FileClose($file) msg("",$return[28]) msg("",$return[29]) EndFunc func xml_test2() Local $file = @ScriptDir & "\test.xml" Local $oXML = ObjCreate("Microsoft.XMLDOM") ;~ $oXML.load("D:\___BUILDS___\___SRMT___\test.xml") $oXML.load($file) $oOther= $oXML.SelectSingleNode("//Configuration/Categories/Category/SubCategories/SubCategory/Settings/Setting") ; or //other ConsoleWrite("$oOther.text=[" & $oOther.text & "]" & @CRLF) EndFunc i know it is not enough what I'm trying to do but I'm realy stuk in what to do next. I've searched in the XML.udf but could not find in the examples what to do what i want to do. The things what i found are about <settings>false</settings> writing style of XML and not the way I've the XML. (or I'm reading it wrong) Is there somebody who can help me on mine way or has a good example script? Thanks in advanced
  10. Hi All, Once again returning back to this great community for much needed help. I am sure that I wont be disappointed and you guys will point me in the right direction. To begin with, I am very new here and I have been learning AutoIT. Few months ago I was able to write a script to automate a program to perform some desired task and it has been working great. But, all hell broke lose when I moved this to a Windows 7 VM the script wont even perform the first key commands and after few changes in the code it started working but break intermittently also the compiled scripts wont work at all. Any help will be much appreciated.
  11. Im trying to iterate through a 2d array created by ProcessList() function that returns a 2d array containing names and pid's, i wanted to filter through the names and delete entries that have "svchost.exe" and this is how i did it Func _Sanitize($array) For $x = 1 To UBound($array) - 1 ConsoleWrite($array[$x][0] & @CRLF) If $array[$x][0] == "svchost.exe" Then _ArrayDelete($array, $x) EndIf Next EndFunc ;==>_Sanitize And i get this error message What is wrong?
  12. Global Const $DIR_WA_FOLDER = @MyDocumentsDir & '\Whatsapp Extension' Global Const $DIR_SHORTCUT = @DesktopDir & '\WhatsappWeb.exe' Func _Create_Shortcut() Local $sMessage = "Creating shortcut " _Metro_SplashTextScreen(1, "", $sMessage) AdlibRegister("_Metro_LoopInProgress") If FileExists($DIR_WA_FOLDER) Then $iDelete = FileDelete($DIR_SHORTCUT) If $iDelete Then _FileWriteLog($LOG_INSTALLATION, "Debug: Desktop's shortcut is deleted.") Else _FileWriteLog($LOG_INSTALLATION, "Debug: Desktop's shortcut is not found. But, desktop's shortcut is still created.") EndIf If FileExists($DIR_WA_FOLDER & '\WhatsappWeb.exe') Then $iCreate = FileCreateShortcut($DIR_WA_FOLDER & '\WhatsappWeb.exe', $DIR_SHORTCUT) If $iCreate Then _Metro_MsgBox(0, "", "Desktop shortcut is now created!") _FileWriteLog($LOG_INSTALLATION, "Debug: Desktop's shortcut is created.") Else _Metro_MsgBox(0, "", "Desktop shortcut is failed to created!") _FileWriteLog($LOG_INSTALLATION, "Error: Fail to create shortcut.") EndIf Else _Metro_MsgBox(0, "", "Source not found!") _FileWriteLog($LOG_INSTALLATION, "Error: WhatsappWeb.exe is not found.") EndIf Else _Metro_MsgBox(0, "", "Source not found!") _FileWriteLog($LOG_INSTALLATION, "Error: Whatsapp Extension folder is not found.") EndIf AdlibUnRegister("_Metro_LoopInProgress") _Metro_SplashTextScreen(0) EndFunc So I do have a button to trigger this create shortcut to desktop. But after it created shortcut at desktop, I cannot execute the shortcut as it has no any response. Then I go try trigger the file at the source path @MyDocumentDir & '\Whatsapp Extension\WhatsappWeb.exe' and it work as expected. Then I go to check my log, and it shows:- (P/S: I already did trigger the function twice) 2019-02-28 23:27:32 : Debug: Desktop's shortcut is not found. But, desktop's shortcut is still created. 2019-02-28 23:27:33 : Debug: Desktop's shortcut is created. 2019-02-28 23:28:40 : Debug: Desktop's shortcut is not found. But, desktop's shortcut is still created. 2019-02-28 23:28:41 : Debug: Desktop's shortcut is created. So based on my log shows, it failed to locate the shortcut, but it did exists there. P/S: This project is done developed weeks ago, every testing is passed. Is just somehow the executable cannot be execute. Any advise?
  13. my .au3 file runs without any problems with SciTE editor. But when I compiled it to exe file, it is give me errors. below you can see my code and error with my AutoIt versions. How can I solve this? SciTE Version 4.1.0 autoIt script file name = gitversion.au3 complide exe file name = gitversion.exe #RequireAdmin ;set mouse coordinates relative to window size by giving value 0 for second parameter AutoItSetOption('MouseCoordMode', 0) $System32Dir=@SystemDir $SystemDriveLetter=Stringleft($System32Dir,1) ;$SystemDriveLetter example is 'C' drive in the hard-disk (windows installed drive letter) ;msgbox(0,0,'System drive letter is: ' & $SystemDriveLetter) DirRemove($SystemDriveLetter & ":\GitTest\Git",1) DirCreate($SystemDriveLetter & ":\GitTest") Local $gitHere = $SystemDriveLetter & ":\GitTest" DirCreate($SystemDriveLetter & ":\JasperDesti") ; Disable user input from the mouse and keyboard. BlockInput(True) SplashTextOn("Installing","Please Wait..!", 200, 50) Run("cmd.exe") WinWaitActive("Administrator: " & $SystemDriveLetter & ":\WINDOWS\SYSTEM32\cmd.exe", "") $gitBashPath = $SystemDriveLetter & ":\Program Files\Git\bin\sh.exe" ControlSend("Administrator: " & $SystemDriveLetter & ":\WINDOWS\SYSTEM32\cmd.exe", "", "", '"' & $gitBashPath & '" --login') ;ControlSend("Administrator: C:\WINDOWS\SYSTEM32\cmd.exe", "", "", '"C:\Program Files\Git\bin\sh.exe" --login') Send("{Enter}") ControlSend("Administrator: " & $SystemDriveLetter & ":\WINDOWS\SYSTEM32\cmd.exe", "", "", 'cd ' & $gitHere) Send("{Enter}") ControlSend("Administrator: " & $SystemDriveLetter & ":\WINDOWS\SYSTEM32\cmd.exe", "", "", 'git clone https://mcmedisoft.visualstudio.com/Git/_git/Git && echo "cloned"') Send("{Enter}") Local $gitSignIn = WinWait('Sign in to your account', '', 6) $lowerSysDriveLetter = StringLower($SystemDriveLetter) ;$gitSignIn = 0 means sign in window didn't apper because user already signed in to bash. $gitSignIn != 0 means user hasn't signed in and should type passwords. If $gitSignIn == 0 Then ControlSend("MINGW64:/" & $lowerSysDriveLetter & "/GitTest", "", "", "cd Git") Send("{Enter}") ControlSend("MINGW64:/" & $lowerSysDriveLetter & "/GitTest", "", "", "git checkout WorkerEvent") Send("{Enter}") ControlSend("MINGW64:/" & $lowerSysDriveLetter & "/GitTest", "", "", "exit") Send("{Enter}") ControlSend("MINGW64:/" & $lowerSysDriveLetter & "/GitTest", "", "", "exit") Send("{Enter}") Else WinActivate('Sign in to your account') ;MouseClick('primary', 126, 338, 2, 0) SplashOff() ; Enable user input from the mouse and keyboard. BlockInput(False) WinWaitClose('Sign in to your account') ; Disable user input from the mouse and keyboard. BlockInput(True) SplashTextOn("Installing","Please Wait..!", 200, 50) ControlSend("MINGW64:/" & $lowerSysDriveLetter & "/GitTest", "", "", "cd Git") Send("{Enter}") ControlSend("MINGW64:/" & $lowerSysDriveLetter & "/GitTest", "", "", "git checkout WorkerEvent") Send("{Enter}") ControlSend("MINGW64:/" & $lowerSysDriveLetter & "/GitTest", "", "", "exit") Send("{Enter}") ControlSend("MINGW64:/" & $lowerSysDriveLetter & "/GitTest", "", "", "exit") Send("{Enter}") ; Enable user input from the mouse and keyboard. BlockInput(False) WinWaitActive("Administrator: " & $SystemDriveLetter & ":\WINDOWS\SYSTEM32\cmd.exe", "", 4) ControlSend("Administrator: " & $SystemDriveLetter & ":\WINDOWS\SYSTEM32\cmd.exe", "", "", 'exit') Send("{Enter}") EndIf ; Enable user input from the mouse and keyboard. BlockInput(False) WinWaitClose("MINGW64:/" & $lowerSysDriveLetter & "/GitTest") DirRemove($SystemDriveLetter & ":\JasperDesti\tomcat", 1) ;$tomcatCreateSuccess = DirCreate($SystemDriveLetter & ":\JasperDesti\tomcat") ;DirCreate($SystemDriveLetter & ":\JasperDesti\tomcat") $sSourceFolder = $SystemDriveLetter & ":\GitTest\Git" $sDestFolder = $SystemDriveLetter & ":\JasperDesti\tomcat" _CopyFolder($sSourceFolder,$sDestFolder) SplashTextOn("Completed","Done..!", 200, 50) Sleep(1000) SplashOff ; _CopyFolder funchtion is use to copy a folder while displaying a progress bar func _CopyFolder($sSourceFolder,$sDestFolder) dirremove($sDestFolder,1) local $iSourceSize = DirGetSize($sSourceFolder), $iDestSize local $pid = Run(@AutoItExe & ' /AutoIt3ExecuteLine "DirCopy(''' & $sSourceFolder & ''', ''' & $sDestFolder & ''')"') ProgressOn("Copy Progress", "Please Wait...") Do $iDestSize = dirgetsize($sDestFolder) local $ipct = int(($iDestSize/$iSourceSize)*100) ProgressSet($ipct,$ipct & ' percent complete') sleep(20) Until not ProcessExists($pid) ProgressOff() endfunc
  14. So I had compiled my AutoIT script into executable file, I think like few weeks ago. But once after I compiled the script to executable file, I tested it and it work as expected. Somehow, I just now wanna try to execute it but failed Any idea what's is going on? Do I need to recompile the script again? @@
  15. Here is an existing AS400 PCOM script that I have: #include-once #cs ---------------------------------------------------------------------------- UDF Header Title: _PCOMM UDF Header Version: 0.1.0 AutoIt Version: Author: Jason S. - Jewelry Supply, Inc. Script Function: PCOMM UDF Header For use with IBM AS/400 - IBM OS/400 - IBM System i - IBM i application system. This PCOMM UDF Header targets ASW - an ERP application suite written in IBM's RPG language (yuck!), although it will work for any AS/400 system and is not ASW specific. PCOMM allows injection of keystrokes into the datastream of a running terminal/console application ("Green Screen" Console Emulator). - Assumes Session 'A' but can be overriden using the aswConnect() function. PCOMM allows observing of characters in the datastream of a running terminal/console application ("Green Screen" Console Emulator). - Assumes Session 'A' but can be overriden using the aswConnect() function. #ce ---------------------------------------------------------------------------- Global $Session = "A" Global $Ps Global $Oia ; Specify session to connect to Func aswSetSession($nSession) $Session = $nSession EndFunc ; Connect to ASW ; @param $nSession - Specify session to connect to. Ex: "A" Func aswConnect($nSession = $Session) $Obj_ConnMgr = ObjCreate("PCOMM.autECLConnMgr") $OBJ_EmulSession = ObjCreate("PCOMM.autECLSession") $OBJ_EmulSession.SetConnectionByName($nSession) $Ps = $OBJ_EmulSession.autECLPS $Oia = $OBJ_EmulSession.autECLOIA EndFunc ; Send Data to ASW ; if $rownum and $colnum are not specified, defaults to the cmd line Func aswSend($keys, $rownum = 20, $colnum = 7, $inhibit = 1) $Ps.SendKeys($keys, $rownum, $colnum) if $inhibit = 1 Then While $Oia.InputInhibited <> 0 WEnd EndIf $Oia.WaitForInputReady() EndFunc ; Get Data from ASW Func aswGet($row, $col, $length) $info = $Ps.GetText($row,$col,$length) return $info Endfunc ; Check which page we are on ; @param $page - Page to see if we are on. Ex: "DMR30101" == Sales Order Maintenance page Func checkScreen($page, $rownum = 1, $colnum = 72, $length = 8) If StringInStr(aswGet($rownum, $colnum, $length), $page) Then Return 1 Else Return 0 EndIf EndFunc I would like to use it launch a connection to the AS400. I have an executable that I run with an hod file. Do I just need to run the exe and hod file then run the session connect function and send keys function to pass credentials?
  16. Have come across an issue where I use the below code to select and then click an item. It works great on every computer but one, which happens to be my bosses computer (of course right lol). So SelectItem works fine, but for some reason, the ClickItem command keeps clicking the item below the correct item (but only on this computer. I changed the command to controlsend instead, but i'd rather use the click option.. any ideas here? _GUICtrlTreeView_SelectItem($hWnd, $Array2[1]) _GUICtrlTreeView_ClickItem($hWnd, $Array2[1], "right")
  17. I have a python script automate.py and I wanna run it via CMD. As I know to execute python via CMD is something like this $CMD = "Something python here" Run(@ComSpec & " /c " & $CMD) But how can I just open the 1 CMD and send multiple commands to the CMD based on the function called? For instance like: Launch CMD and send python then send import automate If google() function is called - send automate.google() to the CMD If yahoo() function is called - send automate.yahoo() to the CMD I don't want to execute multiple CMD to call the automate functions. This is due to inside the python script have global variable to handle duplicate flag. So if I execute multiple CMD to call the functions, the global variable will be keep new as NULL. Which is not my expectation. Thanks
  18. I only found that AutoIt can actually execute the entire python script or execute the .exe (converted to .exe from .py) But what if I just want call the particular function? If that possible to do so? This is because python can't create fancy GUI like AutoIT does. So my plan is use AutoIT to have fancy GUI. Then each buttons will trigger specific function in the python script or .exe file. For instances: btnSum - trigger function in python script or .exe file (funcSum) btnMinus - trigger function in python script or .exe file (funcMinus) Thanks for advance information.
  19. Hello my friends Can we create a single context menu on more than one item? For example, a context menu includes standardized options on more than one control, such as buttons or check boxes to Create a context menu on one item am using this function GUICtrlCreateContextMenu ($ HWND) How to link it with more than one element please? or if we can't do that, please give me a solution so i tried to add an context menus to all the controls but the script will be long, for that if their are any solutions i hope to give it to me thanks in advanced
  20. Global $iLableID Func _Metro_SplashTextScreen($Flag, $Title = "", $Text = "", $mWidth = 600, $Fontsize = 11, $ParentGUI = "") Local $msgbDPI = _HighDPICheck() Local $SplashScreen_Form If $Flag = 1 Then If $HIGHDPI_SUPPORT Then $mWidth = Round($mWidth * $gDPI) Else $Fontsize = ($Fontsize / $Font_DPI_Ratio) EndIf Local $LabelSize = _StringSize($Text, $Fontsize, 400, 0, "Arial", $mWidth - (30 * $msgbDPI)) Local $mHeight = 120 + ($LabelSize[3] / $msgbDPI) $SplashScreen_Form = _Metro_CreateGUI($Title, $mWidth / $msgbDPI, $mHeight, -1, -1, False, $ParentGUI) GUICtrlCreateLabel(" " & $Title, 2 * $msgbDPI, 2 * $msgbDPI, $mWidth - (4 * $msgbDPI), 30 * $msgbDPI, 0x0200, 0x00100000) GUICtrlSetBkColor(-1, _AlterBrightness($GUIThemeColor, 30)) GUICtrlSetColor(-1, $FontThemeColor) _GUICtrlSetFont(-1, 11, 600, 0, "Arial", 5) $iLableID = GUICtrlCreateLabel($Text, 15 * $msgbDPI, 50 * $msgbDPI, $LabelSize[2], $LabelSize[3], -1, 0x00100000) GUICtrlSetBkColor(-1, $GUIThemeColor) GUICtrlSetColor(-1, $FontThemeColor) GUICtrlSetFont(-1, $Fontsize, 400, 0, "Arial", 5) GUISetState(@SW_SHOW) Sleep(500) Return 1 ElseIf $Flag = 0 Then GUIDelete($SplashScreen_Form) Return 1 Else Return SetError(0, "", "Error: Invalid flag value") EndIf EndFunc ;==>_Metro_SplashTextScreen Func _Metro_SetSplashText($newMessage) If $newMessage <> "" Then GUICtrlSetData($iLableID, $newMessage) Sleep(500) EndIf EndFunc ;==>_Metro_SetSplashText #include "MetroGUI-UDF\MetroGUI_UDF.au3" $sMessage = "Copying" _Metro_SplashTextScreen(1, "", $sMessage) For $i = 1 To 10 $sMessage = $sMessage & "." _Metro_SetSplashText($sMessage) Next _Metro_SplashTextScreen(0) I don't know why it keep stuck on showing "Copying" without updating. Any idea? Expected result: update the Copying by adding dots/second, without flickering. Please kindly advise.
  21. Hi, I need to read specific location from .pdf that has digital signature on it. I have gone through forum related this, I have seen screen capture and Tessaract example. I don't known how to get exact location. Please help me out with this. Thanks, Khalid Ansari
  22. _Metro_SplashTextScreen(1, "", $iMsg) AdlibRegister("_Metro_LoopInProgress") DirRemove($DIR_WA_FOLDER, 1) Local $iCopy = _WinAPI_ShellFileOperation($CUR_WA_FOLDER, $DIR_WA_FOLDER, $FO_COPY, BitOr($FOF_SIMPLEPROGRESS, $FOF_NOCONFIRMMKDIR)) AdlibUnRegister("_Metro_LoopInProgress") _Metro_SplashTextScree If @error Then _Metro_MsgBox(0, "", $iCopy) _FileWriteLog($LOG_INSTALLATION, "Error: " & $iCopy) Else _Metro_MsgBox(0, "", "Application is up to date!") _FileWriteLog($LOG_INSTALLATION, "Debug: Application is up to date.") EndIf According to the help file of _WinAPI_ShellFileOperation there are a lot of failure and error code. But how can I handle all of them and display corresponding error message based on the help file? The incident is like this: I'll lock the folder with permission, so when I execute the _WinAPI_ShellFileOperation to copy and overwrite the folder contents, it popped me an error message saying that permission issue to caused I can't access the folder and overwrite the contents. Then I clicked Cancel button, and my AutoIT application exit immediately and it's not execute the function _Metro_MsgBox(0, "", $iCopy) to display the message. Anyway, I did also tried the code below, the it still display "Application is up to date!" According to the help file, 120 - Security settings denied access to the source. If @error = 120 Then _Metro_MsgBox(0, "", $iCopy) _FileWriteLog($LOG_INSTALLATION, "Error: " & $iCopy) Else _Metro_MsgBox(0, "", "Application is up to date!") _FileWriteLog($LOG_INSTALLATION, "Debug: Application is up to date.") EndIf
  23. I have a application that have a function is to create a shortcut to desktop, lets say is ChromePortable.lnk. $iCreate = FileCreateShortcut($DIR_WA_FOLDER & '\GoogleChromePortable.exe', $DIR_SHORTCUT, $DIR_WA_FOLDER, '--kiosk "https://example.com/"') So the shortcut will be launch as kiosk mode and force to enter the specific website. However, the user is still able to right-click on the shortcut and modify the target value to remove the kiosk mode. What can I do to disable the user to editing the target value? So far, I had asked and tried from SuperUser for advises Disable Shortcut Target Field icacls "ChromePortable.lnk" /GRANT EVERYONE:RX So this will set the permission of this shortcut file to only Read & Execute only! But after I set it, the user is still can modify. Please kindly advise. Please note and assume that user don't have Administration account or etc, that should be only have 1 account to logon to the computer. EDIT: I must disable inheritance to remove all others permissions like SYSTEM, ADMINISTRATORS, etc. Then only GRANT everyone for READ & EXECUTE only. But still the user can go to edit the permissions tho. Any advise?
  24. The original UDF is Metro UDF v5.1 Recently, I have added new function to handle similar like SplashTextOn Func _Metro_SplashTextScreen($Flag, $Title = "", $Text = "", $mWidth = 600, $Fontsize = 11, $ParentGUI = "") Local $msgbDPI = _HighDPICheck() Local $SplashScreen_Form $iMsg = $Text If $Flag = 1 Then If $HIGHDPI_SUPPORT Then $mWidth = Round($mWidth * $gDPI) Else $Fontsize = ($Fontsize / $Font_DPI_Ratio) EndIf Local $LabelSize = _StringSize($Text, $Fontsize, 400, 0, "Arial", $mWidth - (30 * $msgbDPI)) Local $mHeight = 120 + ($LabelSize[3] / $msgbDPI) $SplashScreen_Form = _Metro_CreateGUI($Title, $mWidth / $msgbDPI, $mHeight, -1, -1, False, $ParentGUI) GUICtrlCreateLabel(" " & $Title, 2 * $msgbDPI, 2 * $msgbDPI, $mWidth - (4 * $msgbDPI), 30 * $msgbDPI, 0x0200, 0x00100000) GUICtrlSetBkColor(-1, _AlterBrightness($GUIThemeColor, 30)) GUICtrlSetColor(-1, $FontThemeColor) _GUICtrlSetFont(-1, 11, 600, 0, "Arial", 5) $iLableID = GUICtrlCreateLabel($Text, 15 * $msgbDPI, 50 * $msgbDPI, "", $LabelSize[3], -1, 0x00100000) GUICtrlSetBkColor(-1, $GUIThemeColor) GUICtrlSetColor(-1, $FontThemeColor) GUICtrlSetFont(-1, $Fontsize, 400, 0, "Arial", 5) GUISetState(@SW_SHOW) Return SetError(1, 0, "") ElseIf $Flag = 0 Then _Metro_GUIDelete($SplashScreen_Form) Return SetError(1, 0, "") Else Return SetError(0, "", "Error: Invalid flag value") EndIf EndFunc ;==>_Metro_SplashTextScreen Then I call it from my main application I got error display when exited. It didn't got any impact to the result, but just wondering why it show this error. This error only appear when my main application trigger this function, but not from my test application to trigger this function. Test application at here: Test Application This is the function code where trigger the error. Func _iMExit() For $i_HR = 0 To UBound($iGUI_LIST) - 1 Step +1 _Metro_GUIDelete($iGUI_LIST[$i_HR][0]) Next DllCallbackFree($m_hDll) _GDIPlus_Shutdown() EndFunc ;==>_iMExit ....... Func _Metro_GUIDelete($GUI) GUISetState(@SW_HIDE, $GUI) ;To prevent visible delay when the gui is being deleted _WinAPI_RemoveWindowSubclass($GUI, $m_pDll, 1010) GUIDelete($GUI) ;Remove from Global GUI List Local $CLEANED_GUI_LIST[0] For $i_HR = 0 To UBound($iGUI_LIST) - 1 Step +1 If $iGUI_LIST[$i_HR][0] <> $GUI Then ReDim $CLEANED_GUI_LIST[UBound($CLEANED_GUI_LIST) + 1][16] For $i_Hx = 0 To 11 Step +1 $CLEANED_GUI_LIST[UBound($CLEANED_GUI_LIST) - 1][$i_Hx] = $iGUI_LIST[$i_HR][$i_Hx] Next EndIf Next $iGUI_LIST = $CLEANED_GUI_LIST ;~ _ReduceMemory() EndFunc ;==>_Metro_GUIDelete Any idea what is going on? Because before this, I also got create another input function just for password purpose. (Duplicate & similar to _Metro_InputBox) But it didn't got any error display on console when exited.
  25. If FileExists($DIR_WA_FOLDER) = 0 Then Local $Decisions = _Metro_MsgBox(4, "", "Do you want to install Extension?") If $Decisions = "Yes" Then DirCopy($CUR_WA_FOLDER, $DIR_WA_FOLDER, 1) _Metro_MsgBox(0, "", "Extension is installed") _FileWriteLog($LOG_INSTALLATION, "Debug: Application is installed.") Else _Close_Application() EndIf EndIf Due to the folder have a lot of files need to copy, so it need some time to complete the copy process. But in the meantime, how can I display a message box saying that "Installation is in progress. Please wait....", with this Metro GUI UDF design? I know that inside the Metro UDF have a function called ProgressBar, but I am not very sure how to use them with my copying progress. Please kindly advise. Here is the sample code of Metro UDF use of ProgressBar $Progress1 = _Metro_CreateProgress(100, 195, 300, 26) For $i = 0 To 85 Step +2 Sleep(1) _Metro_SetProgress($Progress1, $i) Next Here is the function declaration: ; #FUNCTION# ==================================================================================================================== ; Name ..........: _Metro_CreateProgress ; Description ...: Creates a simple progressbar. ; Syntax ........: _Metro_CreateProgress($Left, $Top, $Width, $Height[, $EnableBorder = False[, $Backgroud_Color = $CB_Radio_Color[, ; $Progress_Color = $ButtonBKColor]]]) ; Parameters ....: $Left - Left pos. ; $Top - Top pos. ; $Width - Width. ; $Height - Height. ; $EnableBorder - [optional] Enables a 1px border from each side for the progressbar. Default is False. ; $Backgroud_Color - [optional] Background color. Default is $CB_Radio_Color. ; $Progress_Color - [optional] Progress color. Default is $ButtonBKColor. ; Return values .: Array containing basic information about the progressbar that is required to set the % progress. ; =============================================================================================================================== Func _Metro_CreateProgress($Left, $Top, $Width, $Height, $EnableBorder = False, $Backgroud_Color = $CB_Radio_Color, $Progress_Color = $ButtonBKColor) Local $Progress_Array[8] If $HIGHDPI_SUPPORT Then $Left = Round($Left * $gDPI) $Top = Round($Top * $gDPI) $Width = Round($Width * $gDPI) $Height = Round($Height * $gDPI) EndIf $Progress_Array[1] = $Width $Progress_Array[2] = $Height $Progress_Array[3] = "0xFF" & Hex($Backgroud_Color, 6) $Progress_Array[4] = "0xFF" & Hex($Progress_Color, 6) $Progress_Array[5] = StringReplace($CB_Radio_Hover_Color, "0x", "0xFF") $Progress_Array[7] = $EnableBorder ;Set Colors Local $ProgressBGPen = _GDIPlus_PenCreate($Progress_Array[5], 2) ;Create Graphics Local $Progress_Graphic = _iGraphicCreate($Width, $Height, $Progress_Array[3], 1, 5) ;Draw Progressbar border If $EnableBorder Then _GDIPlus_GraphicsDrawRect($Progress_Graphic[0], 0, 0, $Width, $Height, $ProgressBGPen) EndIf ;Release created objects _GDIPlus_PenDispose($ProgressBGPen) ;Create bitmap handles and set graphics $Progress_Array[0] = GUICtrlCreatePic("", $Left, $Top, $Width, $Height) $Progress_Array[6] = _iGraphicCreateBitmapHandle($Progress_Array[0], $Progress_Graphic) ;For GUI Resizing GUICtrlSetResizing($Progress_Array[0], 768) Return $Progress_Array EndFunc ;==>_Metro_CreateProgress ; #FUNCTION# ==================================================================================================================== ; Name ..........: _Metro_SetProgress ; Description ...: Sets the progress in % of a progressbar. ; Syntax ........: _Metro_SetProgress(Byref $Progress, $Percent) ; Parameters ....: $Progress - Array of the progressbar that has been returned by _Metro_CreateProgress function. ; $Percent - A value from 0-100. (In %) ; =============================================================================================================================== Func _Metro_SetProgress(ByRef $Progress, $Percent) ;Set Colors Local $ProgressBGPen = _GDIPlus_PenCreate($Progress[5], 2) Local $ProgressBGBrush = _GDIPlus_BrushCreateSolid($Progress[4]) ;Create Graphics Local $Progress_Graphic = _iGraphicCreate($Progress[1], $Progress[2], $Progress[3], 1, 5) ;Draw Progressbar If $Percent > 100 Then $Percent = 100 If $Progress[7] Then Local $ProgressWidth = (($Progress[1] - 2) / 100) * $Percent _GDIPlus_GraphicsDrawRect($Progress_Graphic[0], 0, 0, $Progress[1], $Progress[2], $ProgressBGPen) _GDIPlus_GraphicsFillRect($Progress_Graphic[0], 1, 1, $ProgressWidth, $Progress[2] - 2, $ProgressBGBrush) Else Local $ProgressWidth = (($Progress[1]) / 100) * $Percent _GDIPlus_GraphicsFillRect($Progress_Graphic[0], 0, 0, $ProgressWidth, $Progress[2], $ProgressBGBrush) EndIf ;Release created objects _GDIPlus_PenDispose($ProgressBGPen) _GDIPlus_BrushDispose($ProgressBGBrush) ;Create bitmap handles Local $SetProgress = _iGraphicCreateBitmapHandle($Progress[0], $Progress_Graphic) _WinAPI_DeleteObject($Progress[6]) $Progress[6] = $SetProgress EndFunc ;==>_Metro_SetProgress It is not necessary need to use ProgressBar, instead I just to display some meaningful information while waiting the copy progress to complete. Thanks for advanced information.
  • Create New...