Run a macro when opening file from command line?

General questions about using TextPad

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

Post Reply
BryceS
Posts: 22
Joined: Tue Dec 02, 2003 12:53 am
Location: New Zealand

Run a macro when opening file from command line?

Post by BryceS »

Hi,

Does anyone know if it is possible to open a file from the command line in textpad and specify a macro to run automatically?

Maybe something like:

start textpad "c:\temp\myfile" ?macro_name?


If possible, what is the syntax?

Regards,
Bryce Stenberg
(Harness Racing New Zealand computer dept.)
User avatar
helios
Posts: 710
Joined: Sun Mar 02, 2003 5:52 pm
Location: Helios Software Solutions
Contact:

Post by helios »

I'm sorry, it isn't possible to run TextPad macros from the command line. The parameters that can be used, are listed in the Help files Reference Information section.
Helios Software Solutions
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

It is possible to accomplish the same thing using another tool like Macro Scheduler in conjunction with TextPad.

I use Macro Scheduler every day to do some nightly routines off hours. Included in that work is a process to Open TextPad, Open a File, Run a TextPad Macro to parse the file. Save the modified file, Close TextPad, open the next programs to process the Saved file, performs other tasks, and sends off some emails to users with summary results.

These are scheduled events that run unattended, no intervention required.
Hope this was helpful.............good luck,
Bob
BryceS
Posts: 22
Joined: Tue Dec 02, 2003 12:53 am
Location: New Zealand

Post by BryceS »

Thanks Stephen - I was thinking that was probably the case after having already read the command line reference for parameters, guess I was hoping there was an undocumented feature maybe kicking around.
Can I suggest it somewhere as an enhancement request?

Thanks for your suggestion Bob, but that won't really be suitable for what I am trying to do which is open a file in textpad from a batch file that is run when I compile code from within textpad. Compiler can't return any error info, it is just embedded in the error file which the batch file can open for me - I just wanted a macro to then run automatically to bookmark all the errors and jump to the first one. (as per thread a couple of days ago "Tools - Registers - ascertain file, line or column setting?").

Regards,
Bryce Stenberg.
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

I think that can still be done using Macro Scheduler.


Use a TextPad tool to call the batch file that then calls Macro Scheduler to finish up for you.

Just add a call to Macro Scheduler in the batch file.

You could have two options for batch file content:
1. Everything in the batch file could be incorporated into the Macro Scheduler script or
2. The batch file would do its normal things, then at the end it would call a Macro Scheduler script that would open another copy of TextPad, or stay in the same copy to perform your tasks.
Hope this was helpful.............good luck,
Bob
Post Reply