Page 1 of 1
Run a macro when opening file from command line?
Posted: Thu Apr 22, 2004 2:05 am
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.)
Posted: Thu Apr 22, 2004 12:15 pm
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.
Posted: Thu Apr 22, 2004 2:45 pm
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.
Posted: Thu Apr 22, 2004 9:16 pm
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.
Posted: Thu Apr 22, 2004 9:29 pm
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.