-
Posts
296 -
Joined
-
Last visited
Recent Profile Visitors
301 profile views
Palestinian's Achievements
-
I understand that this thread is over 10 years old but AS400 hasn't changed much since the thread was started. I haven't tried using AutoIt to automate AS400 yet, instead I'm using the built-in Macro/Script function which uses VBScript. If you decide to use that functionality instead of AutoIt please keep in mind that IBM's documentation does not always give you the correct syntax to use with AS400, an example would be: Example Dim autECLPSObj as Object '<- incorrect syntax, Dim autECLPSObj is the correct syntax Dim Row, Col, WaitString Set autECLPSObj = CreateObject("PCOMM.autECLPS") autECLPSObj.SetConnectionByName("A") WaitString = "Enter USERID" Row = 20 Col = 16 if (autECLPSObj.WaitForString(WaitString,Row,Col,10000)) then '<- incorrect syntax, If auECLPSObj.WaitForString(WaitString,Row,Col,10000) is the correct syntax msgbox WaitString " " found at " " Row " "," " Col else msgbox "Timeout Occurred" end if You can also use the SearchText method with row/col parameters to look up for the text in the username box and that will return its coords,
-
Palestinian reacted to a post in a topic: How do you close an IE tab?
-
luger reacted to a post in a topic: How do you close an IE tab?
-
Nope.
-
>Here's some reading to do.
-
Palestinian reacted to a post in a topic: _IECreateEmbedded Cache
-
Palestinian reacted to a post in a topic: _IECreateEmbedded Cache
-
_IECreateEmbedded Cache
Palestinian replied to Palestinian's topic in AutoIt General Help and Support
Yeah I kind of figured as much and used the following: Func CacheChange() RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "Cache", "REG_EXPAND_SZ", "C:\TempAppFiles") EndFunc ;==>CacheChange Func CacheReset() RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "Cache", "REG_EXPAND_SZ", "%USERPROFILE%\AppData\Local\Microsoft\Windows\Temporary Internet Files") EndFunc ;==>CacheReset Thank you again, I really appreciate your help. -
_IECreateEmbedded Cache
Palestinian replied to Palestinian's topic in AutoIt General Help and Support
Cheers mate. Another question if it isn't asking too much, is there a way to set a seperate folder for _IECreateEmbedded cache? -
Hello everyone, I was wondering where does _IECreateEmbedded store its cache? I'm thinking about creating a little program for my everyday online surfing and I want its cache to be kept so the program won't reload the whole thing whenever I start it.
-
Working in Hidden Browser Windows
Palestinian replied to 4b0082's topic in AutoIt General Help and Support
What you have so far should do the trick, just add a Sleep when nothing is found. #include <IE.au3> #RequireAdmin Market() Func Market() While 1 $dData = InetRead("https://www.paidverts.com/") If StringInStr($dData, "$3") Then MsgBox(1, "Alert", "Something is cheaper than $4!") ExitLoop Else Sleep(30000) EndIf WEnd EndFunc ;==>Market -
Back, with more questions.
Palestinian replied to Palestinian's topic in AutoIt General Help and Support
I just love complecating things, its kind of my thing you know. And yes, I should've picked a better title, my bad. -
Palestinian reacted to a post in a topic: Trouble with WinWait
-
Hello everyone It's been a long time since I last posted (or even checked) the forums, been busy a lot lately... But I'm back for a while now, and I have some questions regarding integerated web automation, I know its possible with IE.au3 using _IECreateEmbedded, but what I'm really interested in is something that was asked by JohnOne about 4 years ago, GeckoFX. (>Original Post). I've been thinking that since its been 4 years now since that question was asked, maybe there's been a few updates that dealt with such an issue? I've came across some applications made with C# that implemented GeckoFX and I really want to try doing it with AutoIt since my knowledge in programming is limited to few aspects in AutoIt with no time for learning a new programming language. Regards, Palestinian.
-
Palestinian reacted to a post in a topic: FTP File Read
-
AmirAshkan2012 reacted to a post in a topic: How Much Internet Traffic Used?
-
How Much Internet Traffic Used?
Palestinian replied to AmirAshkan2012's topic in AutoIt General Help and Support
HandyCafe, Google it. -
How can I embed a media player in my script?
Palestinian replied to computergroove's topic in AutoIt General Help and Support
Don't "bump" your thread unless it's been +24 hours without any replies to it. -
Download this, extract it to a folder and save this script in the same folder: #include <GuiEdit.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> #include "UIAWrappers.au3" #include <Misc.au3> AutoItSetOption("MustDeclareVars", 1) #AutoIt3Wrapper_UseX64=Y ;Should be used for stuff like tagpoint having right struct etc. when running on a 64 bits os dim $oldUIElement ; To keep track of latest referenced element dim $Form1, $Edit1, $label1, $label2, $msg, $x, $y, $oUIElement, $oTW, $objParent, $oldElement, $text1, $t ;~ Some references for reading ;~ [url=http://support.microsoft.com/kb/138518/nl]http://support.microsoft.com/kb/138518/nl[/url] tagpoint structures attention point ;~ [url=http://www.autoitscript.com/forum/topic/128406-interface-autoitobject-iuiautomation/]http://www.autoitscript.com/forum/topic/128406-interface-autoitobject-iuiautomation/[/url] ;~ [url=http://msdn.microsoft.com/en-us/library/windows/desktop/ff625914(v=vs.85).aspx]http://msdn.microsoft.com/en-us/library/windows/desktop/ff625914(v=vs.85).aspx[/url] HotKeySet("{ESC}", "Close") ; Set ESC as a hotkey to exit the script. HotKeySet("^w", "GetElementInfo") ; Set Hotkey Ctrl+M to get some basic information in the GUI #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 1024, 768, 192, 124) $Edit1 = GUICtrlCreateEdit("", 10, 10, 600, 700) ;~ $Edit1 = GUICtrlCreateEdit("", 10, 10, 10, 10) $Label1 = GUICtrlCreateLabel("Ctrl+W to capture information", 640,10,600,25) $Label2 = GUICtrlCreateLabel("Escape to exit", 640,45,600,25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### _UIA_Init() ; Run the GUI until the dialog is closed While true $msg = GUIGetMsg() sleep(100) ;~ if _ispressed(01) Then ;~ getelementinfo() ;~ endif If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd Func GetElementInfo() Local $hWnd Local $tStruct = DllStructCreate($tagPOINT) ; Create a structure that defines the point to be checked. ;~ Local $tStruct = DllStructCreate("INT64,INT64") ;~ Local $tStruct =_AutoItObject_DllStructCreate($tagPoint) ToolTip("") Global $UIA_oUIAutomation ;The main library core CUI automation reference Global $UIA_oDesktop, $UIA_pDesktop ;Desktop will be frequently the starting point Global $UIA_oUIElement, $UIA_pUIElement ;Used frequently to get an element Global $UIA_oTW, $UIA_pTW ;Generic treewalker which is allways available $x=MouseGetPos(0) $y=MouseGetPos(1) DllStructSetData($tStruct, "x", $x) DllStructSetData($tStruct, "y", $y) consolewrite(DllStructGetData($tStruct,"x") & DllStructGetData($tStruct,"y")) ;~ consolewrite("Mouse position is retrieved " & @crlf) $UIA_oUIAutomation.ElementFromPoint($tStruct,$UIA_pUIElement ) ;~ $objUIAutomation.ElementFromPoint(DllStructGetPtr($tStruct),$pUIElement) ;~ consolewrite("Element from point is passed, trying to convert to object ") $oUIElement = objcreateinterface($UIA_pUIElement,$sIID_IUIAutomationElement, $dtagIUIAutomationElement) $UIA_oUIAutomation.RawViewWalker($UIA_pTW) $oTW=ObjCreateInterface($UIA_pTW, $sIID_IUIAutomationTreeWalker, $dtagIUIAutomationTreeWalker) If IsObj($oTW) = 0 Then msgbox(1,"UI automation treewalker failed", "UI Automation failed failed",10) EndIf local $parentHandle $oTW.getparentelement($oUIElement,$parentHandle) $objParent=objcreateinterface($parentHandle,$sIID_IUIAutomationElement, $dtagIUIAutomationElement) If IsObj($objParent) = 0 Then msgbox(1,"No parent", "UI Automation failed failed",10) EndIf if isobj($oldUIElement) Then if $oldUIElement=$oUIElement then return endif endif _WinAPI_RedrawWindow(_WinAPI_GetDesktopWindow(), 0, 0, $RDW_INVALIDATE + $RDW_ALLCHILDREN) ; Clears Red outline graphics. GUICtrlSetData($Edit1, "Mouse position is retrieved " & $x & "-" & $y & @CRLF) $oldElement=$oUIElement If IsObj($oUIElement) Then ;~ ConsoleWrite("At least we have an element " & "[" & _UIA_getPropertyValue($oUIElement, $UIA_NamePropertyId) & "][" & _UIA_getPropertyValue($oUIElement, $UIA_ClassNamePropertyId) & "]" & @CRLF) GUICtrlSetData($Edit1, "At least we have an element " & "[" & _UIA_getPropertyValue($oUIElement, $UIA_NamePropertyId) & "][" & _UIA_getPropertyValue($oUIElement, $UIA_ClassNamePropertyId) & "]" & @CRLF,1) $text1="Title is: <" & _UIA_getPropertyValue($oUIElement,$UIA_NamePropertyId) & ">" & @TAB _ & "Class := <" & _UIA_getPropertyValue($oUIElement,$uia_classnamepropertyid) & ">" & @TAB _ & "controltype:= " _ & "<" & _UIA_getControlName(_UIA_getPropertyValue($oUIElement,$UIA_ControlTypePropertyId)) & ">" & @TAB _ & ",<" & _UIA_getPropertyValue($oUIElement,$UIA_ControlTypePropertyId) & ">" & @TAB _ & ", (" & hex(_UIA_getPropertyValue($oUIElement,$UIA_ControlTypePropertyId)) & ")" & @TAB & @CRLF $text1=$text1 & "*** Parent Information ***" & @CRLF $text1=$Text1 & "Title is: <" & _UIA_getPropertyValue($objParent,$UIA_NamePropertyId) & ">" & @TAB _ & "Class := <" & _UIA_getPropertyValue($objParent,$uia_classnamepropertyid) & ">" & @TAB _ & "controltype:= " _ & "<" & _UIA_getControlName(_UIA_getPropertyValue($objParent,$UIA_ControlTypePropertyId)) & ">" & @TAB _ & ",<" & _UIA_getPropertyValue($objParent,$UIA_ControlTypePropertyId) & ">" & @TAB _ & ", (" & hex(_UIA_getPropertyValue($objParent,$UIA_ControlTypePropertyId)) & ")" & @TAB & @CRLF $text1=$text1 & "*** Detailed properties of the highlighted element ***" $text1= $text1 & @CRLF & _UIA_getAllPropertyValues($oUIElement) GUICtrlSetData($Edit1, "Having the following values for all properties: " & @crlf & $text1 & @CRLF, 1) _GUICtrlEdit_LineScroll($Edit1, 0, 0 - _GUICtrlEdit_GetLineCount($Edit1)) $t=stringsplit(_UIA_getPropertyValue($oUIElement, $UIA_BoundingRectanglePropertyId),";") _UIA_DrawRect($t[1],$t[3]+$t[1],$t[2],$t[4]+$t[2]) EndIf EndFunc ;==>Example Func Close() Exit EndFunc ;==>Close Run the script and point at the Connect/Disconnect button then hold Ctrl + W, it should give you an idea on what the button is, post the result here.