Page 1 of 1

Tool/Macro problem

Posted: Tue Nov 30, 2004 5:00 pm
by lionelb
I have written a small Windows program called SendCB which simply sends the contents of the clipboard as a sequence of keystrokes to a specified application window. I would like to be able to use it from TextPad to send the current selection to the specified window. To this end, I add SendCB as a tool to the Tools menu and assign it an accelerator key (F10, say). So far so good - I can select some text, copy it to the clipboard, hit F10 and bingo, the text appears in the window of my specified app.

To automate this, I then try to record a macro that (1) copies the current selection to the clipboard and then (2) invokes the SendCB tool via the F10 key. The macro recording appears to go ok. To test it, I select some text, play the macro and... zilch, nada, nothing happens. At this point I RTFM and find that Tools (and accelerator keys in general?) cannot be recorded... any alternative ideas as to how I might get this to work?

Posted: Tue Nov 30, 2004 9:28 pm
by bveldkamp
Maybe you can change your program so that it sends a Ctrl+C keystroke to the active window first? Or have it accept a command line parameter, and add $sel to your tool definition.

And I'm sure that someone will soon mention MacroScheduler as a solution. I haven't used it myself, but apparantly it can be used to automate such tasks as you describe.

HTH, Berend

Posted: Tue Nov 30, 2004 10:30 pm
by Bob Hansen
someone will soon mention MacroScheduler
I'll do that for you:

I can strongly recommend that uou use Macro Scheduler for that and many more tasks.
Also has a syntax file for use with TextPad.

Posted: Thu Dec 02, 2004 10:06 am
by lionelb
Maybe you can change your program so that it sends a Ctrl+C keystroke to the active window first? Or have it accept a command line parameter, and add $sel to your tool definition.
Thanks, turns out that $Clip does the job nicely.
I can strongly recommend that uou use Macro Scheduler for that and many more tasks.
Hmm, I occasionally use the more free (as in beer) AutoIt3.

Regards,

Macro Scheduler

Posted: Mon Dec 27, 2004 5:37 pm
by charles
Thanks for the link Bob - Macro Scheduler is priceless
I had never heard of it before ...