Tool/Macro problem

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
User avatar
lionelb
Posts: 34
Joined: Fri Mar 19, 2004 11:58 am
Location: Brighton, UK

Tool/Macro problem

Post 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?
Lionel B
bveldkamp

Post 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
User avatar
Bob Hansen
Posts: 1517
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post 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.
Hope this was helpful.............good luck,
Bob
User avatar
lionelb
Posts: 34
Joined: Fri Mar 19, 2004 11:58 am
Location: Brighton, UK

Post 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,
Lionel B
charles
Posts: 20
Joined: Mon Dec 27, 2004 5:11 pm
Contact:

Macro Scheduler

Post by charles »

Thanks for the link Bob - Macro Scheduler is priceless
I had never heard of it before ...
Post Reply