julia Posted September 22, 2012 Posted September 22, 2012 Dear all, I'm quite new with AutoIt and programming in general. I'm trying to use AutoIt to periodically download data from a device which has an associated software for this purpose. I'd like to use a simple function that I found in the web: _ControlMouseClick.au3 but I can't. Global $aPos $iTitle = "Kestrel® Tracker - Communicator" $iText = "&Load from Kestrel® Tracker" $iControl = "132512" $iButton = "left" $iClicks = "1" $iSpeed = "10" $iXpos = "" $iYpos = "" $iOriginal = Opt("MouseCoordMode", 2) ;Get the current MouseCoordMode; Change the MouseCoordMode to relative coords $aPos = ControlGetPos($iTitle, $iText, $iControl) ;Get the position of the given control ;MouseClick($iButton,$aPos[0] + ($aPos[2]/2) + $iXpos, $aPos[1] + ($aPos[3]/2) + $iYpos, $iClicks, $iSpeed) ;Move the mouse and click on the given control Opt("MouseCoordMode",$iOriginal) ;Change the MouseCoordMode back to the original Trying to find out the problem, I would like to see the value of a variable ($aPos) on SciTE4AutoIt3 command line (?), how should I do that? This is probably a very basic question but I would apprecite very much your help. Thanks in advance.
Moderators Melba23 Posted September 22, 2012 Moderators Posted September 22, 2012 julia,Welcome the the AutoIt forum. You can do this by using either ConsoleWrite (the data appears in the lower SciTE pane while the script continues) or MsgBox (you see a dialog and the script halts until it is closed). Here is how you might do it:Global $aPos $iTitle = "Kestrel® Tracker - Communicator" $iText = "&Load from Kestrel® Tracker" $iControl = "132512" $iButton = "left" $iClicks = "1" $iSpeed = "10" $iXpos = "" $iYpos = "" $iOriginal = Opt("MouseCoordMode", 2) ;Get the current MouseCoordMode; Change the MouseCoordMode to relative coords $aPos = ControlGetPos($iTitle, $iText, $iControl) ;Get the position of the given control ; Do some errorchecking If IsArray($aPos) Then ; Now choose one of these and comment out the other ConsoleWrite($aPos[0] & " - " & $aPos[1] & @CRLF) MsgBox(0, "Position", $aPos[0] & " - " & $aPos[1]) Else ; And then the matching one of these ConsoleWrite("Error" & @CRLF) MsgBox(0, "Position", "Error") EndIf ;MouseClick($iButton,$aPos[0] + ($aPos[2]/2) + $iXpos, $aPos[1] + ($aPos[3]/2) + $iYpos, $iClicks, $iSpeed) ;Move the mouse and click on the given control Opt("MouseCoordMode",$iOriginal) ;Change the MouseCoordMode back to the originalAll clear? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
julia Posted September 24, 2012 Author Posted September 24, 2012 Dear M23, thank for your reply. I understand yuor suggestion. I tried it with a different control and it works. Thank you very much.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now