-
Posts
55 -
Joined
-
Last visited
Everything posted by Anoop
-
Tray Event not working from the second try.
Anoop replied to Anoop's topic in AutoIt General Help and Support
@Jos, Thank you very much for the clarification. -
Tray Event not working from the second try.
Anoop replied to Anoop's topic in AutoIt General Help and Support
Hi @nitekram Thanks for the reply. This is the alternate way I found. But I liked your quick response. Hi @Jos and @nitekram, If it is the issue with return, how it worked for the first time. I am triggering the first event when in start(). It worked correctly. Then again coming to start() and triggering the second event. Now it is not working. Moreover, this is OnEvent mode and my understanding is that this event should be captured regardless of where the script is. -
Tray Event not working from the second try.
Anoop replied to Anoop's topic in AutoIt General Help and Support
I found alternate way. But It seems, it is a bug in AutoIt software. -
Hi All, I am facing an issue with tray event. The tray event is not getting captured from the second time. It correctly worked for the very first time. I have copied my code below. There is a simple gui with a "START" button. When the button is clicked, it just sends a winhttp request continuously with 5 seconds delay. A tray menu item "Stop" is there and on selecting it, it asks whether to stop the operation - It works perfectly for the first time. But after I confirm to stop and again START the operation from GUI. Now try to select "Stop" tray menu option. It does not work. Can someone be kindful to help? #include <MsgBoxConstants.au3> #include <GUIConstantsEx.au3> Local $oMyError1 = ObjEvent("AutoIt.Error", "WinhttpError", "IWinHttpRequestEvents") Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") Opt("TrayAutoPause",0) Opt("TrayMenuMode",1 + 2) Opt("TrayOnEventMode",1) Local $oStopTray = TrayCreateItem("Stop") TrayItemSetOnEvent(-1,"_stop") $hGUI = GUICreate("Tray Event",100,50) $hButton = GUICtrlCreateButton("START", 10, 10, 75, 25) GUI() Func GUI() Opt("TrayIconHide",1) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $hButton GUISetState(@SW_HIDE) Start() EndSwitch WEnd EndFunc Func Start() Opt("TrayIconHide",0) while 1 $oHTTP.Open("GET", "http://www.google.com") $oHTTP.Send() ConsoleWrite($oHTTP.ResponseBody) Sleep(5000) WEnd EndFunc Func _stop() $iReply = MsgBox($MB_YESNO + $MB_ICONINFORMATION + $MB_TOPMOST,"STOP???", "Analysis in progress. Do you want to stop the operation?") If $iReply == $IDYES Then GUI() Else Return EndIf EndFunc Func WinhttpError() ConsoleWrite(@ScriptName & " (" & $oMyError1.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _ @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oMyError1.number) & @CRLF & _ @TAB & "err.windescription:" & @TAB & $oMyError1.windescription & @CRLF & _ @TAB & "err.description is: " & @TAB & $oMyError1.description & @CRLF & _ @TAB & "err.source is: " & @TAB & @TAB & $oMyError1.source & @CRLF & _ @TAB & "err.helpfile is: " & @TAB & $oMyError1.helpfile & @CRLF & _ @TAB & "err.helpcontext is: " & @TAB & $oMyError1.helpcontext & @CRLF & _ @TAB & "err.lastdllerror is: " & @TAB & $oMyError1.lastdllerror & @CRLF & _ @TAB & "err.scriptline is: " & @TAB & $oMyError1.scriptline & @CRLF & _ @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oMyError1.retcode) & @CRLF & @CRLF) EndFunc thanks very much Anoop
-
#include <Excel.au3> #include <Array.au3> Global $oAppl = _Excel_Open() Global $sWorkbook1 = @ScriptDir & "\Test.xls" Global $oWorkbook1 = _Excel_BookOpen($oAppl, $sWorkbook1, Default, Default, True) $aResult = _Excel_RangeRead($oWorkbook1) _ArrayDisplay ($aResult) $max = _ArrayMax($aResult, 1) MsgBox($MB_SYSTEMMODAL, "","$max is : " & $max) Please try with this. Check if array displayed correctly.
-
Take the data in an array using _Excel_RangeRead and use _ArrayMax to find the highest value.
-
How to send " in the send command
Anoop replied to steve67's topic in AutoIt General Help and Support
You can use single quotes ( ' ) to enclose it. 'interface ip set DNS "local area connection" static 192.168.100.76 primary' -
I tried this in a x64 PC and it is working for me. #include <MsgBoxConstants.au3> If @ProcessorArch = "X86" Then MsgBox($MB_OK, "Tutorial", "32 Bit") Run("tc86\calc.exe", "") Else MsgBox($MB_OK, "Tutorial", "64 Bit") Run("tc64\notepad.exe","") EndIf
-
How to append file path in Autoit
Anoop replied to vikashbitm2010's topic in AutoIt General Help and Support
Hi vikashbitm2010, Great to know that you solved your issue. -
How to append file path in Autoit
Anoop replied to vikashbitm2010's topic in AutoIt General Help and Support
EnvSet("qm_AttachmentsFile" ," D:\myfile.txt") MsgBox(0,"",EnvGet("qm_AttachmentsFile")) The above script is correctly setting the environment variable and I can get it back using EnvGet. But please note - A environment variable set in this way will only be accessible to programs that AutoIt spawns (Run(), RunWait()). Once AutoIt closes, the variables will cease to exist. For permanently setting, you can use the script provided in the below post as reference. -
How to append file path in Autoit
Anoop replied to vikashbitm2010's topic in AutoIt General Help and Support
Unfortunately, I don't think that there is some truth . His question clearly states that, he has a batch file with an environment variable which is getting appended with some file path. And he wants to do it with Autoit. Per my knowledge, envget will not do this. -
How to append file path in Autoit
Anoop replied to vikashbitm2010's topic in AutoIt General Help and Support
@vikashbitm2010, So let BreManNH post help you. If you need any more details, please feel free to ask me. -
How to append file path in Autoit
Anoop replied to vikashbitm2010's topic in AutoIt General Help and Support
Are you getting any error? Please note, Once AutoIt closes, the variables will cease to exist. If you want to permanently set, use registry write operation. Search this forum. -
How to append file path in Autoit
Anoop replied to vikashbitm2010's topic in AutoIt General Help and Support
Use envset for temporarily setting the environment variable. -
What makes DLL open the window (Open With ...)
Anoop replied to odaylton's topic in AutoIt General Help and Support
You can double click the script to open. If the script is running instead of opening in the editor, there was a setting which needs to be selected during the installation. You can check this tutorial AutoIt Download and Installation for details. Please check 6th step. -
So you are getting error when loading the website initially itself. Try to solve it first.
-
Post the full console log.
-
Check https://www.autoitscript.com/autoit3/docs/libfunctions/_IEFormElementSetValue.htm _IEFormElementSetValue($Name,"Henry")
-
How to Schedule script to Run Automatically Windows starts
Anoop replied to zorlar's topic in AutoIt General Help and Support
Add it to startup folder - http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_programs/how-to-add-a-program-to-startup/91d18255-659e-4796-87f6-5e6c814c7d50 -
Check if another AutoIT script is running and pause it
Anoop replied to WoodGrain's topic in AutoIt General Help and Support
JFYI - If you convert it to exe and run, you can see the executable file name in task manager.- 5 replies
-
- wingethandle
- get
-
(and 3 more)
Tagged with:
-
If it is IE browser, you can use IE functions automate these. In the below example, IE opens and navigates to google, minimize browser and searches for autoit. #include <IE.au3> Local $oIE = _IECreate("www.google.com") WinSetState("Google - Windows Internet Explorer","",@SW_MINIMIZE ) $oTxtSearch = _IEGetObjByName($oIE, "q") $oForm = _IEGetObjByName($oIE,"f") _IEFormElementSetValue($oTxtSearch,"autoit") _IEFormSubmit($oForm) ;_IEQuit($oIE)
-
_Excel_RangeRead Strips Number Formating?
Anoop replied to chobo2's topic in AutoIt General Help and Support
_Excel_RangeRead ( $oWorkbook [, $vWorksheet = Default [, $vRange = Default [, $iReturn = 1 [, $bForceFunc = False]]]] ) Change $iReturn to 3 and try.