Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. How I can access a Local Scope without from outside Is there a better way except creating Globals ? #include <GUIConstants.au3> #cs Global $GUI_Window Global $GUI_Label #ce Opt("GUIOnEventMode", 1) Gui_P1() While 1 Sleep(100) WEnd Func Gui_P1() $GUI_Window = GUICreate("P1", 1050, 720, -1, -1) $GUI_Label = GUICtrlCreateLabel("<Nothing>", 25, 20) Local $GUI_Button = GUICtrlCreateButton("Modify",25,300,100) GUICtrlSetOnEvent($GUI_Button, "Modify") GUISetOnEvent($GUI_EVENT_CLOSE, "Gui_P1_Close") GUISetState(@SW_SHOW, $GUI_Window) EndFunc Func Gui_P1_Close() GUIDelete($GUI_Window) Exit EndFunc Func Modify() ConsoleWrite(@CRLF & ">Move") GUICtrlSetPos($GUI_Label, Random(25,250,1), Random(25,250,1)) ConsoleWrite(@CRLF & ">Rewrite") GUICtrlSetData($GUI_Label,"Number: " & Random(0,99,1)) EndFunc
  3. How are you calling that function? If using a hotkey or an OnEvent trigger, it won't work. Those types of function calls don't use the parameters in the function, so the variables are undeclared.
  4. I think you are located directly into autoit folder, which is protected against all modifications. So you need to create one folder in your personal folders for all your autoit scripts. In Windows File Explorer, use right mouse key to open and run your scripts. To create a new script use right mouse with new...
  5. I'm trying to automate the java process, although I'm having error below are you helping me?
  6. Today
  7. AndroidZero, Look at AdlibRegister in the Help file. M23
  8. Is there a way to create a Event Function that runs every x miliseconds while I can interact in another While Loop ? For example opening a GUI working inside it, calling functions etc .. and during all the time my script checks for receiving UDP data
  9. @Amar2801 you do realize this is an AutoIt forum, not Python, correct?
  10. A Excel workbook can be accessed like a database using ADO (example). This allows to bypass all Excel limitations.
  11. Are there any up to date gui designers / builders for Python preferably built for Tkinter? If not what would you guys recommend as a good gui framework to use today considering Tkinter is quite old and doesn't look very modern.
  12. Thanks for help! This code tip worked for meπŸ˜€β˜ΊοΈπŸ˜œ
  13. I have a positive experience about AutoIt GUI, so you found a great option for yourself:)
  14. I just installed the latest version of SciTE editor and now it won't run or compile scripts and the Save function doesn't work. The output window just shows "Access is denied". I can save using "Save as..." with navigation. I can compile by executing AutoIt3Wrapper.exe directly and navigating to the .au3 file to be compiled. I can run a .au3 file by double clicking it, but I can't run a script in the window. I unsintalled and reinstalled - no change. Eset AV is off, in case that's a problem.ο»Ώ Any ideas what I'm doing wrong here?
  15. It's almost the same; only the way you get the 2-Dimension array changes. You need to read the whole sheet in an array, then make a comparsion of a value to extract the data in separate files. One of the easiest way yo do that is using _Excel_RangeRead() with the parameter $bForceFunc set to true as @water suggested, so you'll have the array with all the values, and then you can do whatever you want. But, you could think to use an SQLite database either, which could save you for sure some time. You can find Excel to SQLite converter(s) online, and manage all the SQLite stuffs using _SQLite_* functions in AutoIt
  16. Can you disable keyb/mouse integration with the host? I do find it interesting that running a script within the guest manipulates the host. Does it do it if the VM is minimized or the console closed?
  17. Sorry,the code is not complete ..i didn't revise it πŸ€’ Also, there is no (Edit) Button πŸ™„ Here it is : #NoTrayIcon #AutoIt3Wrapper_UseX64=NO #include <imageSearchEX.au3> Global $imageSearchEX = imageSearchEX Global $_Check_Image = _Check_Image $Your_Window = "";your window $Your_Control = "";your Control $Your_Image = "";your Image While 1 $Coords = $_Check_Image($Your_Window,$Your_Control,$Your_Image) If $Coords <> 0 Then ;Do Something ExitLoop EndIf Sleep(10000) ;Sleep 10 Seconds WEnd Func _Check_Image($Window, $Control, $Image) $Hwnd = WinGetHandle($Window) $Control_Pos = ControlGetPos($Hwnd,$Control) $Coords = $imageSearchEX($Hwnd,$Image) $Result = $Coords If $Coords <> 0 Then Local $Image_Pos[] = [ $Coords[0] - $Control_Pos[0], $Coords[1] - $Control_Pos[1] ] $Result = $Image_Pos EndIf Return $Result EndFunc
  18. You are lucky that I have seen your topic ! ======= First of all, you shouldn't use the ordinary image search function...as it is not good because it requires that the image appears on the screen, so you can't do any other thing while the script is running ,so you need the ~:{:}{ImageSearchEX}{:}:~ function by it,you can search for the image in a specific window...and the function don't require that the image appears on the screen >> only it should appear on the window ,so this function run in the background ======= Image Search EX Topic : https://www.autoitscript.com/forum/topic/196542-image-search-inactive-window-but-not-minimized/ ======= note that : 1 : This function doesn't run on X64 bit ,so you have to make the script run on 32 bit by using : #AutoIt3Wrapper_UseX64=NO 2 : This function requires the window to be shown ,not minimized or hidden. ,so if you want to hide the window : just move it to (-X , -Y) Position that is out of the screen ====== Eventually : Here is the code you need : #NoTrayIcon #AutoIt3Wrapper_UseX64=NO #include <imageSearchEX.au3> Global $imageSearchEX = imageSearchEX Global $_Check_Image = _Check_Image $Your_Window = "";your window $Your_Control = "";your Control $Your_Image = "";your Image While 1 $Coords = $_Check_Image($Your_Window,$Your_Control,$Your_Image) If $Coords <> 0 Then ;Do Something ExitLoop EndIf Sleep(10000) ;Sleep 10 Seconds WEnd Func _Check_Image($Window, $Control, $Image) $Hwnd = WinGetHandle($Window) $Control_Pos = ControlGetPos($Hwnd,$Control) $Coords = $imageSearchEX($Hwnd,$Image) Return $Coords EndFunc
  19. Thanks Water. in light of the UDFs and excels limitations and intricacies, would you have a suggested a different way to do this? I can convert xlsx to csv, and use the csv phase / split functions.
  20. @PaulP when you say "actual drive mapping" do you mean the Target Folder for each path, or the true path to the folder on the dfs server?
  21. As jdelaney points out, you will not get that kind of machine-agnostic work with Sends and MouseClicks; they are just too volatile for that. If you post your code, or explain in more detail what you are trying to do, we will do our best to assist
  22. Use functions like ControlSetText rather than Send, and ControlClick rather that MouseClick. Another option, run it on session 0 (where services run) so that it won't interact with your current user session. Also, if you are only doing file manipulation, just use FileRead and FileWrite. Using Send and MouseClick will make concurrent running scripts easily conflict with each-other.
  23. This is kind of hard to explain...but let me try! What I want to do is run some tasks on a virtual PC independently of my current machine. Say the task is this, running in a loop, it operates on mouse moves and keystrokes, fetches clipboard text 1. Open notepad, type "hello" world 2. Copy "hello" with mouse, and then paste it manually 4 lines lower. 2. Save the file Now when I run tasks like this simultaneously on Virtual Box, my guest OS, mouse, keyboard and clipboard affects the guest host. Same thing with team viewer. Short of running the task on a separate PC, is there a way to have tasks running on virtual machine that is independent of guest OS controls?
  24. $a = DriveGetDrive ("NETWORK") For $i = 0 To UBound($a)-1 ConsoleWrite(DriveMapGet($a[$i]) & @CRLF) Next or is it not a mapped drive? If it's not mapped, you can run a command prompt with 'net use'...not sure if there is an autoit equivalent...parse the output.
  25. Yesterday
  26. @SW_RESTORE = Undoes a window minimization or maximization Restore from the minimized or maximized state, and then set your new state. You also missed a variable in your winmove: $citrix_handle = GUICreate("my test app") GUISetState(@SW_SHOW, $citrix_handle) $hide = WinSetState($citrix_handle,"",@SW_HIDE) MsgBox(1,1,"hide") $show = WinSetState($citrix_handle,"",@SW_SHOW) MsgBox(1,1,"show") $min = WinSetState($citrix_handle,"",@SW_MINIMIZE) MsgBox(1,1,"minimized") WinSetState($citrix_handle,"",@SW_RESTORE) $max = WinSetState($citrix_handle,"",@SW_MAXIMIZE) MsgBox(1,1,"maximized") WinSetState($citrix_handle,"",@SW_RESTORE) $win1 = WinMove($citrix_handle,"",0,0,@DesktopWidth,@DesktopHeight) MsgBox(1,1,"winmove") MsgBox(262144,"Results","Hide=" & $hide & @crlf & "Show=" & $show & @crlf & "Min =" & $hide & @crlf & "Max =" & $max & @crlf & "Win1=" & $win1 & @crlf & @crlf) Just saw your question with WinGetState as well...that returns the sum of ALL states on the window. So if a window exists, is visible and is enabled and that is all, the win state is: 7 Use BitAnd to determine if a particular state is present...such as this checking to see if the window is enabled: If BitAND(WinGetState($win), 4) Then ; Is Enabled EndIf If Not BitAND(WinGetState($win), 4) Then ; Is Disabled EndIf Everything is working as expected, you just have those first few hurdles of determining what is what.
  27. Just my own preference...rather than worrying about double negatives and such, you can do this instead If BitAND(WinGetState($win), 4) Then ; Is Enabled EndIf If Not BitAND(WinGetState($win), 4) Then ; Is Disabled EndIf Sorry to not answer your question though. Do you have a snippet that can reproduce without me having to trust a download? Made a quick snippet: $win = GUICreate("my test app") GUISetState(@SW_SHOW, $win) WinSetState($win,"",@SW_DISABLE) MsgBox(1,1,"I should be 0: [" & BitAND(WinGetState($win), 4) & "]") WinSetState($win,"",@SW_ENABLE) MsgBox(1,1,"I should be greater than 0: [" & BitAND(WinGetState($win), 4) & "]") GUICtrlDelete($win) @autoItVersion = First return is 0 Second return is 4 Both are expected results.
  1. Load more activity
  • Create New...