Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Interfacing with Tcl Script
#1
Hi Gintaras,
I have used QM to interface with one application that supports a Tcl scripting interface. I have used QM to control the application through sending keyboard mapped controls (i.e. QM monitors for triggers and then sends keyboard commands to the app display window which I have mapped internally in the application to perform various actions) and scraping onscreen elements.

The question I have is whether there is a better way to pass information and triggers from one scripting system to the other.

Currently if I want the Tcl script to trigger a macro/function in QM, I write a variables contents to a file which QM is monitoring for any modifications...
e.g.

Function UpdateInfoBox
Trigger $f 0x48 "$system$" "Tcl Output File.txt"     Help - how to add the trigger to the macro

Is there a better in/out mechanism than this? This works ok but sometimes the file is not available or gets locked by the application.

Thanks,
Stuart
#2
1. SendMessage. It would be fastest. Can work synchronously, ie tcl waits while the function is running. Documented in QM help in command line topic.
2. File triggers.
3. command line. Probably slowest. Can work synchronously.
#3
Thanks for pointing that out to me. QM is SO versatile!
I wasn't able to get it to work right away but I think it's because of my poor Tcl script skills but I am sure I will get it eventually. The File triggers are pretty fast though. What do you think the performance reduction is using that method.
The typical strings reading and writing to the file are only about 1-2 kb.

Thanks again,

Stuart
#4
File triggers should be quite fast. SendMessage is just another way.
#5
Thanks for fast reply!
Stuart


Forum Jump:


Users browsing this thread: 1 Guest(s)