
inna
Active Members-
Posts
25 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
inna's Achievements
-
Thanks, but that's not what I meant. Please compare my post to yours and compare the outputs.
-
I got it:) #include <MsgBoxConstants.au3> Local $aDays = StringSplit('me, you, him', ',') For $i = 1 To $aDays[0] ; Loop through the array returned by StringSplit to display the individual values. ConsoleWrite($aDays[$i]) Next
-
Hello, I see For...In...Next help which is this: Local $aArray[4] $aArray[0] = "a" $aArray[1] = 0 $aArray[2] = 1.3434 $aArray[3] = "test" Local $sString = "" For $vElement In $aArray $sString = $sString & $vElement & @CRLF ConsoleWrite($sString) Next But what I'm trying to reach (and failed yet) is: ; the number of items on list or array changes and is not fixed (I don't know the count) $list = ['me', 'you', 'him'] for $i in $list ConsoleWrite($i & @LF) Next ; the console should print: ;me ;you ;him How can I reach this? I have a list of names and I should iterate over. Thanks in advance
-
Hello, I'm not sure but it seems weird to me as an absolute newbie. This is my code: ;#RequireAdmin $title = WinWait('New Tab', '', 3) ;$title = WinWait('[Title:New Tab - Google Chrome]', '', 3) ;$title = WinWait('Untitled - Notepad', '', 3) Sleep(1000) WinActivate($title) Sleep(1000) WinSetState($title, '', @SW_MAXIMIZE) Sleep(1000) WinMove($title, '', 400, 400, 800, 600) The issue is: when I want to set $title to Google Chrome, it only works up to WinSetState and setting Maximize size, but does not change its windows size as stated in WinMove. But with Notepad, it works fine. I even tried with RequireAdmin but it doesn't make any differences for Chrome. I also tried with Edge browser, and got the same result as Chrome. The exit code is 0 for WinMove which is the failure code. I also tried these too: WinMove('click.html', '', 400, 400, 800, 600) The other thing I faced is: if the window is not maximized or I comment out WinSetState, the WinMove function works fine. Only if the window is not maximized, it works with all Chrome, Edge and Notepad. Do you please help me? My user is Administrator and there should be no permission in my mind. I know when I set WinMove then there's not need to set it maximize, but I'm curious if my code is wrong or something else.
-
I can WinActivate osk but I cannot ControlClick on it
inna replied to inna's topic in AutoIt General Help and Support
Thanks a lot:) It's using ControlClick finally on it:) -
inna reacted to a post in a topic: I can WinActivate osk but I cannot ControlClick on it
-
Hi, I'm not sure what's wrong with my code or it's related to Windows's changes like UDF that I cannot ControlClick on a Windows Native app. This is my code: #include <AutoItConstants.au3> $i = 0 While $i <= 10 $i = $i + 1 Local $key = '[Title:On-Screen Keyboard]' ConsoleWrite('The value of i is ' & $i & @LF) $i = $i + 1 Local $key = WinWait('[Title:On-Screen Keyboard]', '', 1) ConsoleWrite('The value of i is ' & $i & @LF) $i = $i + 1 Local $title = '[CLASSNN:DirectUIHWND1]' ConsoleWrite('The value of i is ' & $i & @LF) $i = $i + 1 WinActivate($key) ConsoleWrite('The value of i is ' & $i & @LF) $i = $i + 1 ControlClick($key,'', $title, 'left', 1, 1109, 240) ; Right Shift ControlClick Coords for window size 1390, 320 ConsoleWrite('The value of i is ' & $i & @LF) $i = $i + 1 WinMove($key, '', 800, 100, 400, 400, 100) ConsoleWrite('The value of i is ' & $i & @LF) $i = $i + 1 Run("C:\windows\system32\osk.exe") ConsoleWrite('The value of i is ' & $i & @LF) $i = $i + 1 Local $hWnd = WinGetHandle("[CLASS:OSKMainClass]") ConsoleWrite('The value of i is ' & $i & @LF) $i = $i + 1 ConsoleWrite('The value of i is ' & $i & @LF) $i = $i + 1 Sleep(1000) ConsoleWrite('The value of i is ' & $i & @LF) $i = $i + 1 WinActivate("[CLASS:OSKMainClass]") ConsoleWrite('The value of i is ' & $i & @LF) $i = $i + 1 WinWait("[CLASS:OSKMainClass]", '', 5) ConsoleWrite('The value of i is ' & $i & @LF) $i = $i + 1 $hWnd = WinGetHandle("[CLASS:OSKMainClass]") ConsoleWrite('The value of i is ' & $i & @LF) $i = $i + 1 WinMove($hWnd, "", 563, 387, 1000, 400) ConsoleWrite('The value of i is ' & $i & @LF) $i = $i + 1 WEnd Part of my code is from this topic, but does not work for me (not unexpected, but does not work at all). I put a While loop only to see how it goes and what it does. This is the console: The value of i is 1 The value of i is 2 The value of i is 3 The value of i is 4 The value of i is 5 The value of i is 6 The value of i is 7 The value of i is 8 The value of i is 9 The value of i is 10 The value of i is 11 The value of i is 12 The value of i is 13 The value of i is 14 +>20:50:05 AutoIt3.exe ended.rc:0 +>20:50:05 AutoIt3Wrapper Finished. >Exit code: 0 Time: 20.15 I am trying different ways to run osk, but with Run it does not, but if I run it manually it focuses to that window. But I cannot click on any position of its controls. The reason of using osk is I'm trying to test something in a Windows Remote Desktop after closing the session, so that there's no input of my laptop connected to RDP (like mouse and keyboard). Do you please help me?
-
inna reacted to a post in a topic: How to set While loop until the time is not $time yet
-
How to set While loop until the time is not $time yet
inna replied to inna's topic in AutoIt General Help and Support
Thanks, I added and now it breaks the loop after one iteration. I just decided to add InputBox like this, but the loop does not start. I intend to take time from myself instead of editing the code (I want to compile an EXE so that I can give the app time to start) and then does what I want (in this example it is opening a Chrome browser and then exit): #include <Date.au3> Local $tTime $tTime = _Date_Time_GetLocalTime() Local $hour = InputBox('OK', 'Enter Hour (Between 0-24):') Local $minute = InputBox('OK', 'Enter Minutes (Between 0-59):') Local $second = InputBox('OK', 'Enter Seconds (Between 0-59):') Local $millisecond = InputBox('OK', 'Enter MilliSeconds (Between 0-999):') $hour = Int($hour) $minute = Int($minute) $second = Int($second) $millisecond = Int($millisecond) ;MsgBox($MB_OKCANCEL, 'The Given Values', 'The entered time is ' & $hour & ':' & $minute & ':' & $second & ':' & $millisecond) ConsoleWrite('The entered time is ' & $hour & ':' & $minute & ':' & $second & ':' & $millisecond) While True If ($hour) AND ($minute) AND ($second) AND ($millisecond) Then Run('chrome.exe') WinActivate('Google Chrome') Sleep(500) Send('{F12}') Opt("SendKeyDownDelay", 1000) Send("{ALT down}{F4}") Send('{alt up}') ConsoleWrite("Time achieved" & @CRLF) ExitLoop EndIf WEnd I know there's something wrong with my If, but I cannot find what's wrong with it. -
inna reacted to a post in a topic: How to set While loop until the time is not $time yet
-
How to set While loop until the time is not $time yet
inna replied to inna's topic in AutoIt General Help and Support
It runs my task but loop does not break. This is my code (it finally exits Chrome): #include <Date.au3> Local $tTime While True $tTime = _Date_Time_GetLocalTime() If $tTime.hour = 17 And $tTime.minute = 06 And $tTime.second = 25 And $tTime.mseconds > 599 And $tTime.mseconds < 999 Then Run('chrome.exe') WinActivate('Google Chrome') Sleep(500) Send('{F12}') Opt("SendKeyDownDelay", 1000) Send("{ALT down}{F4}") Send('{alt up}') ConsoleWrite("Time achieved" & @CRLF) Sleep(500) ; make sure you only run it once EndIf Sleep(100) ; so as not overload CPU WEnd And this is the Console's output: >"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\Saeed\Desktop\test.au3" /UserParams +>17:06:20 Starting AutoIt3Wrapper (21.316.1639.1) from:SciTE.exe (4.4.6.0) Keyboard:00000409 OS:WIN_10/2009 CPU:X64 OS:X64 Environment(Language:0409) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\Saeed\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\Saeed\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.16.1) from:C:\Program Files (x86)\AutoIt3 input:C:\Users\Saeed\Desktop\test.au3 +>17:06:20 AU3Check ended.rc:0 >Running:(3.3.16.1):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\Saeed\Desktop\test.au3" +>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+BREAK to Stop. Time achieved Current local time is 17:10. -
inna reacted to a post in a topic: How to set While loop until the time is not $time yet
-
How to set While loop until the time is not $time yet
inna replied to inna's topic in AutoIt General Help and Support
Because there's some reservation that requires to hit the button, and milliseconds is important there due to high traffic of the other people like me try to reserve. -
inna reacted to a post in a topic: How to set While loop until the time is not $time yet
-
How to set While loop until the time is not $time yet
inna replied to inna's topic in AutoIt General Help and Support
Thanks, but I need milliseconds. Can I expand it to 13:19:30:599 for example? -
inna reacted to a post in a topic: How to set While loop until the time is not $time yet
-
Hi, This is my code: #include <Date.au3> #include <MsgBoxConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $hour = @HOUR $min = @MIN $sec = @SEC $msec = @MSEC While Not $hour = 13 And $min = 19 And $sec = 30 And 599 < $msec And $msec < 999 Run('chrome.exe') WinActivate('Google Chrome') Send('{F12}') ConsoleWrite($hour & ':' & $min & ':' & $sec & '.' & $msec & @CRLF) ; *** just for test Sleep(10000) WEnd What I want is until my time is not yet reached to 13:19:30, while loop continues and wait for that time (suppose current time is 13:15:00); I did test this code with "Not" and without it, but as soon as I run the code, it exits successfully. I'm not sure what is wrong logically with the code. I also tested this but it runs forever: #include <Date.au3> #include <MsgBoxConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $hour = @HOUR $min = @MIN $sec = @SEC $msec = @MSEC While 1 if $hour = 13 And $min = 29 And $sec = 10 And 599 < $msec And $msec < 999 Then Run('chrome.exe') WinActivate('Google Chrome') Send('{F12}') ConsoleWrite($hour & ':' & $min & ':' & $sec & '.' & $msec & @CRLF) ; *** just for test EndIf WEnd Is it right? I just want to press one time F12, writes the time on console (it's just for test) and then breaks the loop and exit the program.
-
inna reacted to a post in a topic: ControlClick function not working on Calculator
-
inna reacted to a post in a topic: ControlClick function not working on Calculator
-
ControlClick clicking the correct position
inna replied to inna's topic in AutoIt General Help and Support
Now I'm seeing what's in Summary tab of AutoIt v3 Window Info mean. I see a ControlClick coords that you wrote the code and where it came from, and where is x and y of my mouse there. I think this topic could be closed because I got the answer by your code and investigating more to see how your code works. -
ControlClick clicking the correct position
inna replied to inna's topic in AutoIt General Help and Support
Sorry for asking a lot, I read the docs but I didn't understand this part. This function's coordinates are relative to control? In this case there's only one Notepad window (of course there's a Windows window behind). Please see the attached image. In this picture there are two supposed points: the red dot which is the center of notepad window, and the black dot which is the center of my screen. By relative, you mean relative to the red or black dot? Did I understand your states right? -
inna reacted to a post in a topic: ControlClick clicking the correct position
-
inna reacted to a post in a topic: ControlClick clicking the correct position
-
ControlClick clicking the correct position
inna replied to inna's topic in AutoIt General Help and Support
Yes it worked fine. No, I did not change anything. When I changed x and y to somewhere where MouseClick clicks on, the ControlClick did not work. But Copying exactly your code worked in my screen too. Yes I know I should keep them separated. I just noticed if there's another way to find the proper x and y for ControlClick. Do you help me how did find x and y coordination are 100 and 142? In a bigger screen does it work too? Because the x and y center of another sized screen is different with me (1920 x 1080) and yours (probably 1920 x 1080). -
ControlClick clicking the correct position
inna replied to inna's topic in AutoIt General Help and Support
Thanks, then I should calculate different x and y for different monitors? My screen is 1920*1080, but suppose another screen is 1024*724. Then I think from center of each screen going 100px up and 142px left would be different. Am I right? As I had another topic, please advise how to find a word of button for ControlClick. For ControlClick I think I should find its class name and id and other specs, but for word I'm not sure. , please