Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Triggers help
#2
Try accessible object trigger.

Example with Notepad:
Macro Macro6
Trigger $a 140 -4 "" "msctls_statusbar32" 1025 "" "Notepad" "- Notepad" 41     Help - how to add the trigger to the macro
Code:
Copy      Help
;\
function hwnd idObject idChild
Acc a.FromEvent(hwnd idObject idChild)
str s=a.Name
out s

sel s 1|2
,case "*error*"
,out "ERROR"

How to know the trigger data?
1. Select QM menu Tools -> Output -> Log -> Acc. trigger events. OK.
2. Activate your program and let it change status bar text.
3. Activate QM and uncheck the same menu item (step 1).
4. Look for trigger info in the output pane. It can look like this (or it can be different, but it must contain the status bar text):
Code:
Copy      Help
8. NAMECHANGE, CLIENT, 2
    ow: class="msctls_statusbar32", id=1025
    pw: class="Notepad", name="Untitled - Notepad"
    ao: role=STATICTEXT, state=0x0, name="   Ln 1, Col 2  "
5. In the Properties dialog select trigger "Accessible object". Then enter the trigger info. If using the above info: select EVENT_OBJECT_ -> NAMECHANGE, then in the idObject combobox select CLIENT, in ow class field paste ow class (msctls_statusbar32), in pw fields paste pw class and name, click button Next, select role STATICTEXT.
6. OK. If asks, let it insert trigger data; then uncomment the 2 green lines.
7. Test the trigger: Activate your program and let it change status bar text. If the trigger works, your macro runs and displays status bar text in QM output.


Messages In This Thread
Triggers help - by jfowler - 07-09-2018, 05:23 AM
RE: Triggers help - by Gintaras - 07-09-2018, 11:19 AM
RE: Triggers help - by jfowler - 07-09-2018, 12:44 PM
RE: Triggers help - by Gintaras - 07-09-2018, 03:48 PM
RE: Triggers help - by jfowler - 07-09-2018, 06:24 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)