olo Posted April 18, 2013 Share Posted April 18, 2013 Hey all Im very close to finishing my two week task just when I ctrl + f and search for somethingAny ideas, how can I get the mouse to move where that highlighted text it? Almost finished included is some code though it may not be necessaryI want to search for highlighted text say "Rice" click drag a certain distance.then search for "Vegetables" GOTO where vegetables is highlighted then click and drag a certain distance.MouseGetPos() MouseClickDrag ( "LEFT", MouseGetPos(0), MouseGetPos(1), MouseGetPos(0) + $xdist , MouseGetPos(1) + $ydist) Send("{CTRLDOWN}c{CTRLUP}") Link to comment Share on other sites More sharing options...
Xenobiologist Posted April 18, 2013 Share Posted April 18, 2013 Want do you really want to achieve? Maybe there is an easier way to do that. Example: Scan the html ... If you explain a little more, then you 'll get a good answer. I'm sure. Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
guinness Posted April 18, 2013 Share Posted April 18, 2013 Maybe show what you have, because your problem seems generic with little description. Where are you searching? Is a question that comes to mind. Explorer? Chrome? Firefox? UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Bert Posted April 18, 2013 Share Posted April 18, 2013 Same issue? Also, why does this seem to me this reaks of you trying to automate Farmville or some other game? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted April 18, 2013 Moderators Share Posted April 18, 2013 (edited) Wasting two weeks on trying to automate some stupid game? Who would do that? muttley Edited April 18, 2013 by JLogan3o13 olo 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 18, 2013 Moderators Share Posted April 18, 2013 olo,Why on earth do you want to to drag a highlighted word a certain distance? I would really like to see a screenshot of the app you are trying to automate with an reasonable explanation of what you are trying to do. In fact I would be so disappointed if there was not a good reason that I could well feel it necessary to lock the thread. 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 Link to comment Share on other sites More sharing options...
olo Posted April 19, 2013 Author Share Posted April 19, 2013 Same issue? Also, why does this seem to me this reaks of you trying to automate Farmville or some other game?farmville???.......please dont insult me Link to comment Share on other sites More sharing options...
olo Posted April 19, 2013 Author Share Posted April 19, 2013 olo,Why on earth do you want to to drag a highlighted word a certain distance? I would really like to see a screenshot of the app you are trying to automate with an reasonable explanation of what you are trying to do. In fact I would be so disappointed if there was not a good reason that I could well feel it necessary to lock the thread. M23Im trying to navigate to a row of data. It starts with +7V now if I ctrl + f and enter +7V I see it(obviously).Here I want the mouse to move to that piece of highlighted text and then click,copy and drag to get the data in the row. Link to comment Share on other sites More sharing options...
FireFox Posted April 19, 2013 Share Posted April 19, 2013 If you keep the script of the other topic : PixelSearch($aPos[0] + 15, $aPos[1] + 120, $aPos[2] - 15, $aPos[3] - 15, 0x99c1da, 0, 2) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 19, 2013 Moderators Share Posted April 19, 2013 olo, Telling me that you are looking for rows of data including "Rice", "Vegetables", and "+7V" does not really answer my question as to why you need to find and then drag these items. I asked for a screenshot - are you going to provide one? 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 Link to comment Share on other sites More sharing options...
olo Posted April 19, 2013 Author Share Posted April 19, 2013 olo,Telling me that you are looking for rows of data including "Rice", "Vegetables", and "+7V" does not really answer my question as to why you need to find and then drag these items. I asked for a screenshot - are you going to provide one? M23here is the table of data.I need to extract the data from power consumption.So start at +5V highlight, click, copy drag up to mA.Do this for the other rows.Extract to csv file.Run for multiple pdf'sDoes that clear it up?Doc1.docx Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 19, 2013 Moderators Share Posted April 19, 2013 olo,Thank you - why did you not explain earlier that you were dealing with some form of electrical item listing in a PDF file instead of giving all that guff about "Rice" and "Vegetable" text? As you saw, all that did was make us very confused about what you were asking. I think AutoIt will have trouble automating a PDF file in the manner you require. I would suggest that you use an external tool (why not run it from within an Autoit script ) to extract the text from the PDF into a plaintext format that AutoIt can more easily handle and then use AutoIt to locate the required data within that. A quick search of the forum suggests that xpdf is a good place to start. Good luck and you know where we are if you run into problems. M23 olo 1 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 Link to comment Share on other sites More sharing options...
olo Posted April 19, 2013 Author Share Posted April 19, 2013 olo,Thank you - why did you not explain earlier that you were dealing with some form of electrical item listing in a PDF file instead of giving all that guff about "Rice" and "Vegetable" text? As you saw, all that did was make us very confused about what you were asking. I think AutoIt will have trouble automating a PDF file in the manner you require. I would suggest that you use an external tool (why not run it from within an Autoit script ) to extract the text from the PDF into a plaintext format that AutoIt can more easily handle and then use AutoIt to locate the required data within that. A quick search of the forum suggests that xpdf is a good place to start. Good luck and you know where we are if you run into problems. M23Thanks M23Just my boss requires I do it in autoit and im very close. Just this mouse goto highlighted text issue would solve the task Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 19, 2013 Moderators Share Posted April 19, 2013 olo, Is your boss not open to persuasion that there are better ways to do things? By all means show him my suggestion and see if that sways him. If not, then I can only suggest that you search the PDF GUI for the colour of the "found" text. Does your PDF reader allow you to select a suitably unique colour for the "found" highlight"? 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 Link to comment Share on other sites More sharing options...
Bert Posted April 19, 2013 Share Posted April 19, 2013 You could also simply save the file in a different format. If you can open it in office 2010 then save it to excel. Once you did that then use Excel.au3 and get what you need with ease. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
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