Jump to content

WaitClick(timeout) ??


 Share

Recommended Posts

I dont know how that is going to work. I would love to see it though.

Maybe build some functions and call them sepeartly with a hotkeyset??

Or maybe someone else has other suggestions.

good luck,

Bill

Link to comment
Share on other sites

The text can be random bodies of text on web pages or in email. I'd like this to work anywhere.

Crikey!

You have an enormous project on your hands then.

The reason being that text is extracted differently on almost all controls, for example it's microsoft word, you need code to identify the control, extract text from it, determine if the cursor is over required text.

Then do that with every application you can think of, and you're nearly there.

I think flash objects and images will be your biggest hiccups.

I'd never get into such a thing myself, but wish you the best of luck.

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Aaahhh... that makes more sense now. I have several little scripts here at work that do just that.

But they are not pretty or stable. Mostly just a HKS (hotkeyset) that swoops up the copied text and activates another prog and pastes and so on .....

If you are interseted I can post an example or 2 if this is actually what you are looking for.

As John mentioned there is no pretty way to do this (that I know of) and that makes it hard to make a one size fits all, they have to be adapted to your specific envirnment.  (what is wrong with my spell chacker?)

cya,

Bill

p.s. come to think of it, NewSciTE in my sig is an example of such a thing....

Edited by billo
Link to comment
Share on other sites

Thank you for your replies. I'm a little surprised that there is not a function for what I'm trying to do. It doesn't seem like such a reach. Are you and am I understanding this correctly? There is no

WaitClick(3000,1) (hypothetical)

It waits at this line of the script for you to click somewhere, which places the cursor in some text, times out after 3k milliseconds, and either exits or continues (0vs1) the script for example...

Link to comment
Share on other sites

By your description, it sounded like you want to wait until your mouse cursor is hovering over a particular word in any application.

If that is not correct, then explain in better detail, using an example.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

  • Moderators

tsystems,

Creating something like that does not seem too difficult - press {SPACE} to start the function: :)

#include <Constants.au3>
#include <Misc.au3>

Global $hDLL = DllOpen("user32.dll")

HotKeySet("{ESC}", "On_Exit")
HotKeySet("{SPACE}", "_WaitClick")

While 1
    Sleep(10)
WEnd

Func _WaitClick()

    $nBegin = TimerInit()
    Do
        If _IsPressed("01", $hDLL) Then
            Do
                Sleep(10)
            Until Not (_IsPressed("01", $hDLL))
            Return MsgBox($MB_SYSTEMMODAL, "Return", "Mouse button pressed")
        EndIf
    Until TimerDiff($nBegin) > 3000
    MsgBox($MB_SYSTEMMODAL, "Return", "Timeout")

EndFunc

Func On_Exit()
    DllClose($hDLL)
    Exit
EndFunc
How close is that to what you want? :huh:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Link to comment
Share on other sites

  • Moderators

tsystems,

Do you mean you cannot get it to work when incorporated into your script or that you cannot get the actual example I posted to work? :huh:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...