MACROS -- Macro Scheduler

General questions about using TextPad

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

Post Reply
mo
Posts: 306
Joined: Tue Mar 11, 2003 1:40 am

MACROS -- Macro Scheduler

Post by mo »

Hello,

Reading about this product here, I downloaded a copy.

I would really like to know how to use this tool to create/run macros in an open TextPad file.

I know next to nothing about writing macros (I can use a macro recorder) or scripts and would appreciate any links to HOW TOs that may already exist.

At this time the only way I am able to use the thing with TextPad is by copying a file and pasting it into a new document that is opened by MS...i.e., I can't figure out how to get it to run from within an open TextPad file.

I have MS set up as a tool in TextPad...maybe do not have the settings correct.

Cross posting this in the MS forum.
Best Wishes!
Mike Olds
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Hi mo.....

Macro Scheduler can be used to run TextPad. Here is an excerpt from a Macro Scheduler script (can be edited) that is used to open TextPad and open a file that is downloaded weekly from an ftp site. I then call a TextPad macro that parses the file and saves it. I then close TextPad when the parsed file has been saved. The values in %...% are variables and can be defined and changed anywhere in the macro script. Lines with \\ are comment lines. (Be sure to remove all unwanted trailing spaces on a line).

Macro Scheculer script:
==========================
\\User Defined Variables

\\Get date values from system
Month>mm
Day>dd
Year>yyyy

//Define weekly ftp file
Let>ftpfilename=105%mm%%dd%%yyyy%

\\Define working directory
Let>WorkDir=c:\Data\Downloads

\\Start TextPad and open weekly file
Run Program>c:\program files\textpad 4\textpad.exe "%WorkDir%\%ftpfilename%.txt"
Wait>5

//Call Macro to Run. Cannot enter macro name, must use first letter, arrows, enter.
Press Alt
Send Character/Text>M
Release Alt

//Macro name = FTP TO QA. Go to "F", then move arrows to FTP TO QA
Send Character/Text>F
Press Down
Press Down
Press Enter

Label>Parsing
//Loop until TextPad macro is done parsing file. Runs from 10-200 seconds.
IfFileExists>d:\data\qa4\bumed\db\105%mm%%dd%%yyyy%.asc,CloseTextPad
Message>File not parsed yet, in process....
Wait>15
Goto>Parsing

Label>CloseTextPad
//Close TextPad Program
WaitWindowOpen>TextPad*
WaitReady>3

Press ALT
Send Character/Text>F
Release ALT
Send Character/Text>X
Wait>3

Goto>NextProcess
==============================
The steps in the TextPad macro could also have been done with Macro Scheduler but I had already created the macro in TextPad previously. I may convert the TextPad macro to Macro Scheduler in the future, but it works now, so no pressure to change. The only problem is that that TextPad macro cannot be edited, but the Macro Scheduler version is easy to edit, looks like normal programming text, and has built in editor tools, syntax highlighting. But it is a macro and scheduling tool, not a text editor. Each program has its own specific specialties. Combined together they make a terrific combination.

(Macro Scheduler is available at http://www.mjtnet.com/index.htm?ref=rmh ... rg_2644641)

I will also post this in the Macro Scheduler forum....

Hope this helps,
Bob
Last edited by Bob Hansen on Mon Aug 25, 2003 3:45 pm, edited 1 time in total.
mo
Posts: 306
Joined: Tue Mar 11, 2003 1:40 am

Post by mo »

Thanks Bob, I will study this.
Best Wishes!
Mike Olds
Post Reply