I am just learning this qm2 program and I need a example of the following:
bring up notepad
once note pad is up write 'now is time for all good men"
I need to see the code that does this
very simple for those in the know
Thank you
Posts: 1,769
Threads: 410
Joined: Feb 2003
Here is how I do that. Note: the names have been changed to protect the innocent-- :wink:
run "C:\Program Files\ConTEXT\ConTEXT.exe"
0 WA "ConTEXT"
key "now is time for all good men"
the "0 WA" is a command that tells QM to "wait until active" than keep going.
That does not work for me ?????
David Starmer
Posts: 1,769
Threads: 410
Joined: Feb 2003
Sorry. You just need to replace "C:\Program Files\ConTEXT\ConTEXT.exe" with the path to your notepad (it's somewhere in the "windows" directory structure). And replace "ConTEXT" with "Notepad".
I initally did those two things....Did not work....notepad came up fine....but key command did nit put the text into notepad.
Dave
Posts: 12,087
Threads: 142
Joined: Dec 2002
Maybe notepad starts inactive? Then use act command.
run "notepad"
0.5
act "Notepad"
key "now is time for all good men"
Or maybe some error message is displayed in QM output pane?
If key really does not work, what about outp (paste)?
run "notepad"
0.5
act "Notepad"
outp "now is time for all good men"
Posts: 1,769
Threads: 410
Joined: Feb 2003
if you were to open it manually, and just started typing without clicking "into" or creating a new document, would it appear in Notepad? What I'm getting at here is that the document area may not be "active". And you may need to click into the area in order to "set" the cursor position.