Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Detect Window content, RUN script
#1
I fill out these forums at work, it's our ticket system...

Some forums are filled out *exactly* the same way every time no matter what the context...

So for example, "Work Notes" is a required field, and we always just type "escalating" in the field

[Image: lQM8DCX.png]

Is there a way I could write a macro that will basically DETECT this screen/text, and once it's detected run a script?

I've been reading the help file and feel a little confused, maybe an example would help?

Thanks, and i can't wait for my trail to run out so I can buy this program its amazing.
#2
Why window triggers cannot be used here?
#3
Code:
Copy      Help
int w=wait(3 WV win("Bolthouse Farms SBM - Mozilla Firefox" "MozillaWindowClass"))
Acc a.Find(w "COMBOBOX" " *Level 2 Technician:" "" 0x3011 3)
run "notepad.exe"

hmm... thinking
#4
Gintaras Wrote:Why window triggers cannot be used here?

I'm not super familiar with window triggers, but this ticket system is a web based system, some windows are within windows, and its kinda messy.

What is a "window trigger" (reading now)
#5
Look in Properties dialog.
If this form is a window, then window triggers should work.
But if it is inside a web browser, then will be not so easy.
#6
[Image: mxFd3Mw.png]

It's web based, and oftne windows within windows...

Code:
Copy      Help
int w=wait(3 WV win("Bolthouse Farms SBM - Mozilla Firefox" "MozillaWindowClass"))
Acc a.Find(w "COMBOBOX" " *Level 2 Technician:" "" 0x3011 3)
run "notepad.exe"

This actually kinda worked, but if it didnt find it within a while it like timed out or something...
#7
Try trigger 'window name changed'. Then let the script wait for the accessible object more than 3 s, for example 1000000 s:

Function Function311
Trigger !n"Bolthouse Farms SBM - Mozilla Firefox" "MozillaWindowClass"     Help - how to add the trigger to the macro
Code:
Copy      Help
int w=TriggerWindow
Acc a.Find(w "COMBOBOX" " *Level 2 Technician:" "" 0x3011 1000000)
mes "object found"
#8
I'll play with it now...

Could I have this run in the background all the time?

Also once it runs once, can I have it like loop forever?
#9
Where do I change how many seconds it waits?
#10
this makes me head hurt lol
#11
ANother option - wait for image. To create code, use dialog "Find image".
This works, but consumes 4% CPU when Firefox is maximized, 1920x1050 pixels. The Acc a.Find(... waitTime) also uses quite much CPU, and it depends on web page and where the object is.


Attached Files
.qml   firefox_wait_for_an_image.qml (Size: 6 KB / Downloads: 332)
#12
Also try accessible object triggers. In Properties too. Will need to read Help.
#13
Code:
Copy      Help
int w=wait(3 WV win("Bolthouse Farms SBM - Mozilla Firefox" "MozillaWindowClass"))

What does this mean? w=wait? what's the random 3 for?
#14
Code:
Copy      Help
int w=wait(3 WV win("Bolthouse Farms SBM - Mozilla Firefox" "MozillaWindowClass"))
Acc a.Find(w "COMBOBOX" " *Level 2 Technician:" "" 0x3011 3)
run "notepad.exe"

this works, but if it doesnt see the "level 2 technician" after a while it gives me this error

Code:
Copy      Help
Error (RT) in Macro1:  object not found.  ?
#15
all i'm trying to do is have a script that does this

"If you see this window with the "Level 2 Technician" box, then run this script in 1 second"
#16
DavidBond Wrote:all i'm trying to do is have a script that does this

"If you see this window with the "Level 2 Technician" box, then run this script in 1 second"

This macro waits for "Level 2 Technician" in Firefox.


Attached Files
.qml   Macro2722.qml (Size: 5 KB / Downloads: 346)
#17
OMG THIS IS AMAZING.

you can have images as triggers?!
#18
wait 0 S "image:h2D2F52BC" w 0 16|0x1000

does 1000 refer to seconds waiting to see image?
#19
Click the blue wait, press F1, read...
#20
thank you so much

man, can i paypal u a few bucks for the help?! haha
#21
[Image: mxHlONX.png]

Ok so it works, awesome..

I want it to loop forever, and ive spent an hour tying to figure out the "REP" code, (repeat)

what's the best way to have this "run in the background" so to speak?


Forum Jump:


Users browsing this thread: 1 Guest(s)