Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using text sensitive menus not functioning right
#1
Hi,
I am new here and have just started using QM. I have seen quite much on help .chm file and online help - and have made some macros. but am getting some problems.

I was earlier using autohotkey and it served me well, but the speed of typing long sentences - autoreplace - is giving me some slow speeds. it takes quite some time to type the long sentence which is autoreplaced by the hotstring.


Now using quickmacros I have made this text sensitive menu macro -

1)

That when I type uu6 it should replace with some large text. But the macro works some times outputting the correct text and most of times it just does this - types " v " and copies the text I wanted to put into the clipboard. sometimes it pastes the clipboard even.


Heres the macro --

Code:
Copy      Help
/b/i/C/

U6 :"[][][][]QMC[][][][]   ++================================++[][][][][][][][][]"


2)

Also i would like to use more larger autoreplaced texts too. - BY NOT PASTING THE TEXT but typing the text.
So is there any way I can accelerate the speed of typing text (autoreplaced text by a text sensitive menu macro) to be very fast - but accurate too as well.

For eg. in this macro which takes too much time -

Code:
Copy      Help
/b/i/c/p3

GTRY1 :'"Right-click on the link and select copy link location. This will place the Link's URL into the clipboard. Now you can paste the URL  into the browser's location area, and hit the Enter key on the keyboard. Right-click on the link and select add bookmark Now you can select the link from the bookmark listing. I've also noticed that a referring URL does not seem to be passed along when the referring web page is based on your computer. You may want to take the web page, and save as to your hard disk.  In the process, you can also rename the page to something generic like:  .html."
#2
1)
Is it in any window?

How text pasting works in simple macros, ie not in TS menus? Test this:
Macro Macro1836
Code:
Copy      Help
paste "[][][][]QMC[][][][] ++================================++[][][][][][][][][]"

What is trigger of this TS menu?

In QM 2.3.3 you can use 'Text (TS menu)' trigger instead of 'Keyboard' trigger. Simpler and a bit more reliable. Then menu item text must be uu6, not u6.

Maybe other keyboard software is running? Eg autohotkey. Try to exit and see how QM then works.

To paste text, QM stores text in clipboard and presses Ctrl+V. In your case, the target window somehow does not receive Ctrl.

2)
key speed in TS menus is especially important, therefore TS menus are optimized to send keys as fast as possible, and at the same time reliable and working in all windows. The actual speed depends on how fast the target window processes keyboard input. OS also slows down. In some windows will be faster with opt keysync 1, but it is less reliable, eg macro-pressed keys may be mixed with user-pressed keys if user does not wait (not sure, don't remember).

TS Menu TS Menu8
Trigger $t     Help - how to add the trigger to the macro
Code:
Copy      Help
GTRY1 :opt keysync 1; '"Right-click on the link and select copy link location. This will place the Link's URL into the clipboard. Now you can paste the URL into the browser's location area, and hit the Enter key on the keyboard. Right-click on the link and select add bookmark Now you can select the link from the bookmark listing. I've also noticed that a referring URL does not seem to be passed along when the referring web page is based on your computer. You may want to take the web page, and save as to your hard disk. In the process, you can also rename the page to something generic like: .html.[]"

There is other method of sending keys to a window, using Windows keyboard messages. Should be faster, but works not in all windows. Also, it would be not reliable in TS menus because of unsupported synchronization with user-pressed keys. Other methods are supported only by that type of windows.
#3
3)

I tried exiting the autohotkey script. And rerun the same macro - now with uu6 instead of u6.
results were the same - sometimes it just pastes " v " and only some very few times it pasted the clipboard original data.

I then thought maybe a delay will work. So I tried this -
Code:
Copy      Help
/b/i/C/

TRYU7 :wait 0.5
"[][][][]QMC[][][][]   ++================================++[][][][][][][][][]"

But nothing is happening. only the tryu7 gets deleted.

4)

I also tried this another kind of macro that pastes the text lines followed by clipboard pasting. but its not working.

Code:
Copy      Help
UU8 :"[][][][][][][][]               QMC8++================================++QMC8[][][][][][][][][]"
key Cv          ;; Ctrl+V

and it just paste the first thing but not the clipboard data. How to make it paste the sequence of text followed by the clipboard data ?


5)

I tried the macro in ans 2) too given by u and its starts at normal speed and then speeds up well. but after the text is all written up, it still sends a lot of keystrokes to the window - nothing is typed in these extra keystrokes though but it takes extra time and quite much. What could be that ?

And cant find "Windows keyboard messages" topic by search in the help file. Can you point it out.

thanks.
#4
TS menu item code must be in single line. If need multiple statements, separate with ; or create a function and call it from TS menu.
TS Menu TS Menu7
Trigger $t     Help - how to add the trigger to the macro
Code:
Copy      Help
/b/i/C/

UU6 :"[][][][]QMC[][][][] ++================================++[][][][][][][][][]"
TRYU7 :wait 0.5; "[][][][]QMC[][][][] ++================================++[][][][][][][][][]"
UU8 :str s="[][][][][][][][] QMC8++================================++QMC8[][][][][][][][][]"; s.setclip; key Cv ;; Ctrl+V

Quote:after the text is all written up, it still sends a lot of keystrokes to the window - nothing is typed in these extra keystrokes though but it takes extra time and quite much
What are these keystrokes?

Quote:And cant find "Windows keyboard messages" topic by search in the help file. Can you point it out.
Try function SendCharactersToWindow: pasting to notepad (when notepad is in background)
TS Menu TS Menu7
Trigger $t     Help - how to add the trigger to the macro
Code:
Copy      Help
UU9 :SendCharactersToWindow child "[][][][][][][][] QMC9++================================++QMC9[][][][][][][][][]" ;;child gives focused control handle
It sends characters as WM_CHAR messages. Some windows need keyboard messages, especially for Enter.
#5
1)

Code:
Copy      Help
/b/i/c/p3
UU9 :SendCharactersToWindow child "[][][][][][][][] QMC9++================================++QMC9[][][][][][][][][]" ;;child gives focused control handle

I put this in a ts menu macro and typed uu9 in a notepad - but got this error -

Error in 03-001: unknown identifier.

2)
AND the keystrokes are not there - was a mistake.
#6
Need to create function SendCharactersToWindow and paste the code there.
But better don't use SendCharactersToWindow etc. I tested it more and can say that it is too unreliable. Yesterday I worked with it more, but still cannot make it fast and reliable. To be reliable enough, it must be slower than key. The best way to send big text still is paste. I don't know why it is not working on your PC.


Forum Jump:


Users browsing this thread: 1 Guest(s)