All Activity

This stream auto-updates   

  1. Today
  2. didnt try but, maybe set background color for that item as blue when selected? I placed a white icon and it looks like this
  3. What you could do, is get the active window coordinates and position, make calculations and pass those to the pixel function.. I think it should be easy enough.
  4. I have one script that creates _IECreateEmbedded and another script that does _IEAttach. I do this because when autoit is doing something, the Embedded IE starts stalling (eg jquery progress animation) But there is a new problem. When IE is having its own process (like in the example above) any _IE command is slow (in the script that Attaches). Here is a comparison of when its in separate and when its in same process: Separate process _IETagNameGetCollection : 5000ms Separate process _IEAction: 850ms Same process _IETagNameGetCollection : 1ms Same proccess _IEAction: 135ms If I try to attach to an embedded IE that is done in c#, I get lighting fast results. As you can see, _IE functions work very slow when the embedded IE we are attaching to is made in Autoit. I did a test and if I empty the WHILE loop in IE process I get these results(but the cpu is at 30% as expected): Separate process _IETagNameGetCollection : 33ms Separate process _IEAction: 13ms It slows down if you put anything (like GUIGetMsg) in the WHILE loop. How do I fix this? Create IE: #include <GUIConstantsEx.au3> #include <IE.au3> #include <WindowsConstants.au3> Local $oIE = _IECreateEmbedded() GUICreate("My Embedded Web control Test", 640, 580, (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, $WS_OVERLAPPEDWINDOW + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN) GUICtrlCreateObj($oIE, 10, 40, 600, 360) GUISetState(@SW_SHOW) ;Show GUI _IENavigate($oIE, "http://www.autoitscript.com") $timer = TimerInit() $oLink = _IETagNameGetCollection($oIE, "a", 3) ;takes 1ms ConsoleWrite(TimerDiff($timer) & @CRLF) $timer = TimerInit() _IEAction($oLink, "click") ;takes 135ms ConsoleWrite(TimerDiff($timer) & @CRLF) While 1 Local $iMsg = GUIGetMsg() Select Case $iMsg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd Attach to IE: #include <IE.au3> Local $oIE = _IEAttach("My Embedded Web control Test", "embedded") $timer = TimerInit() $oLink = _IETagNameGetCollection($oIE, "a", 3) ; 5000ms ConsoleWrite(TimerDiff($timer) & @CRLF) $timer = TimerInit() _IEAction($oLink, "click") ; 850ms ConsoleWrite(TimerDiff($timer) & @CRLF) attach.au3 create.au3
  5. THANK YOU SOO MUCH!!!!!!!!!!. YOU'RE THE BEST
  6. I think I found the problem You have two letters set as a hotkey. When the data read from Excel contains an "e" then the Exit hotkey gets triggered. Use keys not contained in the data you send to the other application. The example now uses F1 to start and F4 to exit the script. #include<excel.au3> HotKeySet("{F1}","start") HotKeySet("{F4}","end") Local $oExcel = _Excel_Open() Local $oWorkbook = _Excel_BookOpen($oExcel,"C:\Users\SAHIL\Desktop\l2d\book1.xlsx") Local $aValues = _Excel_RangeRead($oWorkbook) While 1 Sleep(100) WEnd Func start() For $i = 1 To 25 ConsoleWrite("Loop #" & $i & @CRLF) WinActivate("Link2Data") MouseClick("left", 450, 430) Send($aValues[$i-1][0]) ; $_name MouseClick("left", 450, 460) Send($aValues[$i-1][1]) ; $_email Next EndFunc Func end() Exit 0 EndFunc
  7. Will have a look. BTW: There is no need to quote my replies. I know what I have written Simply enter your reply and press the "Submit Reply" button
  8. it still loops only 1 time. I've even tried different loop commands like while and do_until. It always loops only a single time
  9. Can you still connect with Plink to that box (via AutoIt script)? Just cant determine from your post whether the issue is the connection or the command. This code in the link below is how I previously organized my plink commands. The option I chose as of late was to install the linux subsystem feature and use bash, that has been most optimal.
  10. Give this a try: #include<excel.au3> HotKeySet("{s}","start") HotKeySet("{e}","end") Local $oExcel = _Excel_Open() Local $oWorkbook = _Excel_BookOpen($oExcel,"C:\Users\SAHIL\Desktop\l2d\book1.xlsx") Local $aValues = _Excel_RangeRead($oWorkbook) While 1 Sleep(100) WEnd Func start() For $i = 1 To 25 ConsoleWrite("Loop #" & $i & @CRLF) WinActivate("Link2Data") MouseClick("left", 450, 430) Send($aValues[$i-1][0]) ; $_name MouseClick("left", 450, 460) Send($aValues[$i-1][1]) ; $_email Next EndFunc Func end() Exit 0 EndFunc
  11. it's showing that it loops only 1 time. I want it to loop 25 times
  12. I was thinking the same, seems there are some updates that screw some stuff up.
  13. Add some debugging to your script. This way you will see how often it loops: #include<excel.au3> HotKeySet("{s}","start") HotKeySet("{e}","end") Local $oExcel_1= _Excel_Open() Local $oworkbook = _Excel_BookOpen($oExcel_1,"C:\Users\SAHIL\Desktop\l2d\book1.xlsx") While 1 Sleep(1) WEnd Func start() For $i = 1 To 25 ConsoleWrite("Loop #" & $i & @CRLF) Local $_name = _Excel_RangeRead($oworkbook,default,"A" & $i) WinActivate("Link2Data") MouseClick("left",450,430) Send($_name) Local $_email = _Excel_RangeRead($oworkbook,default,"b" & $i) MouseClick("left",450,460) Send($_email) Next EndFunc Func end() Exit 0 EndFunc
  14. Looks like you can do it with the Execute Script feature -- _WDExecuteScript($sSession, 'window.open()', '{}') Once the tab is created, you will need to switch to it using the correct commands before you can interact with it.
  15. Ok, Thank you very much about your UDF.
  16. Good question. Not sure to be honest. I'll post back if I come up with a good example.
  17. my problem is that i cannot get the script to loop. i am fine with working with screen coordinates as anything else might become too complicated for me
  18. How do I open multi Tab in Chrome? Thank you very much
  19. I suggest to use Control* functions. Working with screen coordinates and Send isn't very reliable. When you use the AutoIt Window Info Tool does it "see" the controls where you want to insert your data?
  20. im trying to make an auto form filling script. Link2data is the app where the forms are.
  21. Thank you Danp2. I'm glad I was able to use it normally after rebooting. Thanks for your answers
  22. My question is: Why do you need Pixelsearch at all? Autoit provides means to directly access a window wherever it may be located on the screen. If you could post a screenshot with all private data made unreadable - would help us to help you!
  23. Currently I'm using the PixelSearch command within a loop, and using WinActivate. My issue is that PixelSearch looks either within - 1. A specified rectangular area based on the pixels of your screen resolution. $rectangular = PixelSearch( 599, 113, 648, 160, 0x78B31B) or 2. The entire desktop. (@DesktopHeight and Width) $full_screen_res = PixelSearch( 0,0, @DesktopHeight, @DesktopWidth, 0x78B31B) BUT I need a way to isolate the PixelSearch to an active Window, and THEN the specified rectangular area within that window, being 1920x1080 in resolution. I don't have a screenshot I can share, but the best information I can provide is that the Window will always be a specific resolution (1920x1080), because I'm going to build it that way. If it simplifies the question, I want PixelSearch to search within a specific Window, not my entire desktop resolution. I'm confident this is do-able, but I'm far too new to coding to understand exactly what to search for when self-educating. I know the PixelSearch command itself cannot specify a Window, so I would need to specify this within the loop. My gut feeling is that this doesn't relate to PixelSearch at all, but instead somehow isolating the script itself to a specific Window?
  24. This is not an error. The code is designed to work that way. When you move items in a listbox with the mouse, you can either drop items above or below the target item. Here it's chosen to drop items above the target item with the consequence that you cannot drop items below last item (only above last item). You could also have chosen to drop items below the target item. Then there would have been a similar problem with the first item. Solution. Drop your item just above the last item. Move the last item one item up.
  25. I would like to know on how to login using PowerShell, and what wrong is following coding? Does anyone have any suggestions? Thanks in advance for any suggestions HTML Coding <form id="form-login" action="/login/" method="post"> <input type="hidden" value="aaabbbcccjfheh48u8jdjd" name="FORM_TOKEN" /> <input type="hidden" name="referer" value=""> <label class="mts txtRight col1 required" for="LoginForm_email">E-Mail <span class="required">*</span></label> <input class="ui-inputText" name="LoginForm" id="LoginForm_email" type="email" /> <label class="mts txtRight col1 required" for="LoginForm_password">Password <span class="required">*</span></label> <div class="collection col2"> <input class="ui-inputPassword ui-inputPassword" name="LoginForm[password]" id="LoginForm_password" type="password" /> <button class="ui-button ui-buttonCta" type="submit"> PowerShell Script $clnt = new-object System.Net.WebClient $URL = "https://www.sample.com/login/" $token = "aaabbbcccjfheh48u8jdjd" $username = "sample_username" $password = "sample_password" $postParams = @{FORM_TOKEN=$token; LoginForm_email=$username; LoginForm_password=$password} Invoke-WebRequest -URi $URL -Method POST -body $postParams
  1. Load more activity