Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Triggers help
#4
Probably this accessible object does not raise events. Then cannot use accessible object triggers.

Another way - wait for the accessible object. Note: it consumes some CPU while waiting.
Create new function and assign a window trigger, so that it runs when the window is shown. In tab "Function properties" check "single thread".
In dialog "Find accessible object", capture the status text object. Click Test, OK.
Let the function find the accessible object. Then wait for changed Name in loop. If contains "error", run a macro.

Example with Notepad:
Function Function2
Trigger !ca"- Notepad" "Notepad"     Help - how to add the trigger to the macro
Code:
Copy      Help
int w=TriggerWindow
Acc a.Find(w "STATICTEXT" "" "class=msctls_statusbar32" 0x1005 3 0 "next")
str text=a.Name
out F"Trigger started. Now status text is: {text}"
rep
,0.5 ;;smaller = faster response but more CPU
,if(!IsWindow(w)) ret ;;exit when window closed
,str s=a.Name; err ret
,if(s=text) continue
,text=s
,out F"Status text changed: {s}"
,
,sel s 1|2
,,case "*error*"
,,out "ERROR"
,,;mac "Macro12345"
,,


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)