5 posts in this topic
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 lightning 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?
#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)
Suddenly a RunWait command has stop working after 2 years of no errors, issues, or problems. The code uses RunWait to start Plink.exe, a command-line remote connection tool similar to UNIX ssh. I'm using it to ssh to a linux (Centos) machine, run a Perl script, and redirect the output to a file on a PC running the AutoIt script.
$FilePath = "C:\AutoIT\LED" $FilePathPlus = $FilePath & "\plink.exe" $Code1 = RunWait(@ComSpec & " /c " & $FilePathPlus & " -ssh -l root -pw ?????? 10.170.4.163 /usr/local/nagios/etc/led.pl > C:\AutoIT\LED\led.txt ", @SW_SHOW) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : @ComSpec & " /c " & $FilePathPlus & " -ssh -l root -pw ????? 10.170.4.163 /usr/local/nagios/etc/led.pl > C:\AutoIT\LED\led.txt " = ' & @ComSpec & " /c " & $FilePathPlus & " -ssh -l root -pw ?????? 10.170.4.163 /usr/local/nagios/etc/led.pl > C:\AutoIT\LED\led.txt " & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console The ConsoleWrite output when cut-n-pasted into a DOS box produces the expected file so I know it works. I've also tried many variations of the function moving, adding, and changing the " and ' (quote) marks. Also tried it without the @ComSpec macro and other related functions...e.g. ShellExecuteWait , etc.
The PC is a Windows 10 64bit and AutoIT is version 188.8.131.52.
Searching here and Google has not yielded any clues that helped.
I'm attempting to create a checklist app that performs other functions. For performance, I would like to check the box, then have the button to the right enabled. After that button is pressed, the second checkbox is enabled, and ready to be checked, allowing the second button to be pressed. After the second button is pressed, the completion/exit button is enabled/shown. I have my code that currently creates the GUI, creates the checkbox, but when you check it it enables the button and the next checkbox. Can't seem to figure out a Case for GUISetOnEvent. Any assistance would be appreciated!
#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <EditConstants.au3> #include <MsgBoxConstants.au3> ; Below is the GUI interface _DeploymentProcess() Func _DeploymentProcess() $aStep1 = GUICreate("Deployment Process", 475, 345, 500, 175) $CBcStep1 = GUICtrlCreateCheckbox("1. Step 01.", 15, 25, 300, 25) $BTNS1 = GUICtrlCreateButton("Email 01", 365, 25, 90, 20) $CBcStep2 = GUICtrlCreateCheckbox("2. Step 02.", 15, 50, 300, 25) $BTNS2 = GUICtrlCreateButton("Email 02", 365, 50, 90, 20) GUICtrlSetState($CBcStep2, $GUI_DISABLE) GUICtrlSetState($BTNS1, $GUI_DISABLE) $CBcStep3 = GUICtrlCreateButton("Hurray! You're Complete!", 85, 276, 300, 60) GUICtrlSetState($CBcStep3, $GUI_SHOW) ; Below are the button and checkbox enables/disables. GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIDelete($aStep1) Return ; Step 1 Case $CBcStep1 If GUICtrlRead($CBcStep1) = $GUI_CHECKED Then GUICtrlSetState($BTNS1, $GUI_ENABLE) GUICtrlSetState($CBcStep2, $GUI_ENABLE) Else GUICtrlSetState($BTNS1, $GUI_DISABLE) GUICtrlSetState($CBcStep2, $GUI_DISABLE) EndIf ; Step 2 Case $CBcStep2 If GUICtrlRead($CBcStep2) = $GUI_CHECKED Then GUICtrlSetState($BTNS2, $GUI_ENABLE) GUICtrlSetState($CBcStep3, $GUI_ENABLE) Else GUICtrlSetState($BTNS2, $GUI_DISABLE) GUICtrlSetState($CBcStep3, $GUI_DISABLE) EndIf Case $CBcStep3 If GUICtrlRead($CBcStep2) = $GUI_CHECKED Then GUICtrlSetState($BTNS10, $GUI_ENABLE) GUICtrlSetState($CBcStep3, $GUI_SHOW) Else GUICtrlSetState($CBcStep3, $GUI_EVENT_CLOSE) EndIf Case $GUI_EVENT_CLOSE, $CBcStep3 #comments-end Exit EndSwitch WEnd EndFunc
Is there a way to determine whether the script that is running, is already running, without using;
If WinExists ?
Or is there a way to use "If WinExists" to determine the script itself?
The reason I am asking this is because if I want someone to run the .Exe I have and they rename it to whatever they want, how could I then determine in the script to check if there's already an .Exe open, or the script itself is already open?
Should I use Class, or how do I achieve this?
Thanks in advance.
Id like to build a little helpertool for my boss in office but i dont know how to sart it.
thats no complicated task. im working for an insurancecenter and have to search the customers in different orders and different tags.
due to my boss is old and not really commen with pc he saves the customers without system.
eg, customer andreas statham got an insurenca for his car then i got to search for
andreas statham car, andreas car statham, car andreas statham, statham andreas car, statham car andreas, car statham andreass etc to find all the files from this customer in the harddrive.
some customers also are fmiliarnamed in one file like andreas statam and monika rog are married an both got a carinsurance then i got to earch for
andreas statham monika rog car, andreas statham monika car rog,.... this can take real long to find the right customer if i do it from hand.
how can i realise this someone in here got an excamlple script or has any sugestion?