Sign in to follow this  
Followers 0
olo

Mouse goto highlighted text

15 posts in this topic

Hey all :D

Im very close to finishing my two week task :P

just when I ctrl + f and search for something

Any ideas, how can I get the mouse to move where that highlighted text it?

:D Almost finished :D

included is some code though it may not be necessary

  • I 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}")

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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?


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Wasting two weeks on trying to automate some stupid game? Who would do that? muttley

Edited by JLogan3o13
1 person likes this

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

olo,

Why on earth do you want to to drag a highlighted word a certain distance? :huh:

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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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 :)

Share this post


Link to post
Share on other sites

olo,

Why on earth do you want to to drag a highlighted word a certain distance? :huh:

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

Im 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.

Share this post


Link to post
Share on other sites

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)

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

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? :huh:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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? :huh:

M23

here 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's

Does that clear it up?

Doc1.docx

Share this post


Link to post
Share on other sites

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. :huh:

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

1 person likes this

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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. :huh:

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

Thanks M23

Just my boss requires I do it in autoit and im very close. Just this mouse goto highlighted text issue would solve the task :D

Share this post


Link to post
Share on other sites

olo,

Is your boss not open to persuasion that there are better ways to do things? :huh:

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"? :huh:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0