Jump to content
Macro Express Forums
MEnewb1143

Not selecting type

Recommended Posts

For some reason, this doesn't work.

 

Mouse Move Window 40, 705
Mouse Left Button Down
Mouse Move Window 10, 510
Mouse Left Button Up

 

 

Seems basic enough. Any ideas? Need some delays in there?

 

Thanks!

Share this post


Link to post
Share on other sites

It looks like you are trying to grab the top bar of a window, and slide the window to a different location on the screen???

 

Instead of your first command being "Mouse Move Window 40, 705" I would expect to see something like "Mouse Move Window 40, 5". A y-coordinate of 705 would put the mouse way down toward the bottom of most windows. Maybe you are getting mixed up between mouse position relative to the SCREEN, and relative to the WINDOW. Be sure to click the correct radio button when scripting the mouse move commands.

 

Another way to move a window is with the Window Reposition command.

Share this post


Link to post
Share on other sites

I think you just need to slow down the macro. I inserted a 250 millisecond Mouse Speed command before the other mouse commands and this worked. You can experiment with the timing if necessary.

Share this post


Link to post
Share on other sites

I'll post the entire code as that 'may' have something to do with it.

 

Activate Window: "<window name>"
Mouse Move Window 40, 705
House Left Button Down
 Mouse Speed: 250 Miliseconds(Doesn't seem to help the problem)
 Mouse Move Window 10, 510
Mouse Left Button Up
Variable Set String %T1% from File: "copy.txt"
Activate Window: "%T1%"
Text Type: <ALTD>r<ALTU><CTRLD>v<CTRLU>

 

The main issue is that it's not selecting! :( This works every so often, but as in just about all uses of a macro, I'm trying to save time. :)

 

Thanks

Share this post


Link to post
Share on other sites

Try something like this:

Activate Window: "<window name>"
Mouse Move Window 40, 705
Delay 0.1 Seconds
Mouse Left Button Down
 Mouse Move Window 10, 510
 Delay 0.1 Seconds
Mouse Left Button Up
Variable Set String %T1% from File: "copy.txt"
Activate Window: "%T1%"
Delay 0.1 Seconds
Text Type: <ALTD>r<ALTU><CTRLD>v<CTRLU>
Delay 0.1 Seconds

If it works then optimize it by reducing or removing the various delays.

Share this post


Link to post
Share on other sites

I put mouse delays before every mouse action. It worked.. "better". Is there a way to simply slow down the mouse speed of the selecting part? My guess is that it's instantaneously jumping from one area to another and therefore not selecting the stuff in between.

 

Thanks

Share this post


Link to post
Share on other sites

Another place to introduce a delay is after your Activate Window. And / or put a Wait for Window Title after the Activate. Mouse may be doing its thing before the window is really "there".

Share this post


Link to post
Share on other sites

Tried that particular delay, and many others. I see the mouse move, it's like it's not left clicking, which is how the text is highlighted. Almost like it's just moving around and continuing the macro.

 

Thanks

Share this post


Link to post
Share on other sites

Here's my thinking. I've got delay's all over the place and it doesn't seem to improve anything. I'm thinking that even though the mouse pointer is at the right spot and the left button is held down the next line in the macro is to INSTANTLY move up left. I'm thinking it doesn't like that. Is there a way to move the mouse from point 'a' to point 'b' over 0.2 seconds?

 

Thanks

Share this post


Link to post
Share on other sites
Is there a way to move the mouse from point 'a' to point 'b' over 0.2 seconds?

 

Sure, you could do something like this:

 

<MMS2:50,50><REP3:01:000001:000001:00100:0:01:><MMP2:3,3><MSD:2><ENDREP>

 

Maybe there is a better way to select the text, such as Select All with ctrl-a?

Share this post


Link to post
Share on other sites

Unfortunately this window is used a lot, so type is scrolled by with each use. A select all would be a LOT after a few minutes. Even if that was a possibitly, you can't. :( Only the mouse, that I know of, can select the type. I can do this manualy, no problem! It's just "Mouse down, move, Mouse up" doesn't seem to select the type, even though that's exactly what I'm doing. :/

 

Thanks

Share this post


Link to post
Share on other sites

I think you can record mouse "swipes" using the Macro Recorder.... But I don't think you can customize your code that way (e.g. move mouse 40, 705, etc) -steve

Share this post


Link to post
Share on other sites

Here is how I wrote the macro. It has worked every time I tried it. You may want to bump the milliseconds to 500 or more. With a larger number you should be able to see the mouse move to the first location and then to the second.

 

Activate Window: "notepad"
Wait For Window Title: "notepad"
Mouse Speed: 250 Milliseconds
Mouse Move Window 40, 705
Mouse Left Button Down
 Mouse Move Window 10, 510
Mouse Left Button Up

Share this post


Link to post
Share on other sites
I'll post the entire code as that 'may' have something to do with it.

 

Activate Window: "<window name>"
Mouse Move Window 40, 705
House Left Button Down
 Mouse Speed: 250 Miliseconds(Doesn't seem to help the problem)
 Mouse Move Window 10, 510
Mouse Left Button Up
Variable Set String %T1% from File: "copy.txt"
Activate Window: "%T1%"
Text Type: <ALTD>r<ALTU><CTRLD>v<CTRLU>

 

The main issue is that it's not selecting! :( This works every so often, but as in just about all uses of a macro, I'm trying to save time. :)

 

Thanks

 

Where is the command for doing the 'selecting'?

 

--

Terry, East Grinstead, UK

Share this post


Link to post
Share on other sites
The "selecting" is the mouse highlighting the text in specific coordinates.

 

OK, thanks Stan, I should have been clearer. I meant 'Where is the command(s) that is doing the copying of the selection?'. I didn't see it in the OP's macro extract. He doesn't identify the target window, so it's not fully clear to me what he's doing. Is it a text-based program (like Notepad, or the example I used, TextPad)? A web page? A program with mixture of text and graphics (and the possibility that the mouse is selecting non-text)? Etc. I would typically follow such a mouse-drag selection with a Copy, to get the text to the clipboard...

 

BTW, both your and Kevin's examples work fine here. I use that sort of command set quite often. In fact, yours works for me without the Mouse Speed command. If I include it, then speeds as low as 1 ms work OK. But I normally use Kevin's approach, i.e. with brief delays (typically 100 ms).

 

--

Terry, East Grinstead, UK

Share this post


Link to post
Share on other sites

Have you tried highlighting the text by doing a mouse left button click at the beginning of the text, then SHIFT DOWN and ARROW DOWN(S) and ARROW RIGHT(S) followed by SHIFT UP?

 

Try it manually, and if it works then you can turn it into a macro. When I do the mouse click (in this forum, for example) there is no indication on-screen that the cursor has been placed there, but the subsequent highlighting keystrokes start from that position.

Share this post


Link to post
Share on other sites

Shift doesn't work in this program unfortunately. :( The way I do it manually, is litteraly, holding the left mouse button down, moving it and letting the button up. Gut feeling says it's doing it too quick.

 

Thanks

Share this post


Link to post
Share on other sites

Mouse Move Window 40, 704

Delay 100 Milliseconds

Mouse Left Button Down

Activate Window. "Window name"

Mouse Move Window 39, 702

Delay 100 Milliseconds

Mouse Move Window 38, 699

Delay 100 Milliseconds

Mouse Move Window 37, 697

Delay 100 Milliseconds

Mouse Move Window 36, 695

Delay 100 Milliseconds

 

and so on, might be a hassle but can help in finding the cause to the problem and then being able to speed it up.

Share this post


Link to post
Share on other sites

Mouse Move to beginning of text

Mouse Left Button Down

Mouse Move to end of text

Mouse Left Button Up

 

works fine to highlight text in the posting above this one in this forum. No delays needed. So I'm guessing there is something unusual about the window you are trying to select from.

 

I think you said this works some of the time, just doesn't work reliably. I have noticed, when manually highlighting text with a mouse, especially on a web page, that the mouse has to be in exactly the right place when I press down the left button and start to drag the mouse. Perhaps the positioning is just right on the few times that it does work, and not the other times? For example, I said the above four-line macro worked on postings in this forum. But a slight shift in the screen, scrolling down just a single line, changes the highlighting so I no longer pick up the first character of the first line. Windows doesn't render the screen in exactly the same way from one time to the next.

Share this post


Link to post
Share on other sites
For some reason, this doesn't work.

 

Mouse Move Window 40, 705
Mouse Left Button Down
Mouse Move Window 10, 510
Mouse Left Button Up

 

 

Seems basic enough. Any ideas? Need some delays in there?

 

Thanks!

 

What about

Mouse Move Window 40, 705

Mouse Left Button Down

hit the END or HOME button

Mouse Left Button Up

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...