Page 1 of 3
Editing macros (again? again!)
Posted: Tue Jan 14, 2003 4:14 am
by Al Anway
Re: Editing macros (again? again!)
Posted: Mon Jan 20, 2003 8:38 am
by Berend Veldkamp
Now there's a good idea!
I'll look into this as soon as I got the time, but don't expect anything in the near future
Berend
Re: Editing macros (again? again!)
Posted: Wed Mar 26, 2003 11:36 pm
by Guest
Have you found out anything more? I put some stuff on
http://home.tiscali.nl/~bveldkamp/tpm/
There's a Delphi project to show the contents of a tpm and a description of the tpm format (what I found so far)
I can read *some* macros but I'm not there yet, see description.txt
Berend
Posted: Mon Mar 31, 2003 3:11 am
by Bob Hansen

Ambitious project Al, thanks for trying to do something with this.
I have downloaded the tools you provided. Can't promise what I can do, but will try to force some time on this.
Would also suggest taking a good look at Macro Scheduler as a tool you can use now with any product including Textpad. Macro Scheduler is available at
http://www.mjtnet.com/index.htm?ref=rmh ... rg_2644641. In addition to all of its features, it can be useful to do the recording now to have the reference info when doing the analysis of the TextPad macro. And TextPad has a syntax file for Macro Scheduler already in existence. (You may actually say forget about macros in TextPad, just use Marco Scheduler, let each of these companies specialize in their areas of expertise).
But we can still try to see what can be done here anyway, who knows, maybe Helios will provide some extra help too! Let me get started......
Posted: Mon Mar 31, 2003 6:19 pm
by Bob Hansen
Hello Al....
I have some information that complements what you have done. You did not provide a method for reporting this information. Is it your intention to have info submitted to this forum? Or is there an email address to have information submitted to?
At this time, I will include my analysis to date here (samples are the HEX codes):
===============================
Format looks to be:
1. File Header= (1)character. values include? 0C/1A/OA/13...?
2. Display Name (unlimited?). separator= 18/0F ?
3. Author (unlimited?). separator=44/52/27/00 ?
4. Description (unlimited?) no separator
5. Repeat Method (1) First characters after Description 00=once, 01=repeat through selection, 02=repeat thru end
This would appear to be the end of the macro file "header". The remainer is the actual macro file content. The macro file content appears to have an 8 character sequence (section 6) followed by an Action name (section 7) followed by keystrokes (section 8).
6. Unknown 8 character sequence
Samples include:
00 00 FF FF 01 00 0E 00
00 00 FF FF 01 00 11 00
00 0B FF FF 01 00 11 00
01 00 FF FF 01 00 0F 00
08 02 FF FF 01 00 11 00
0C 00 FF FF 01 00 0E 00
0C 00 FF FF 01 00 14 00
8F 02 FF FF 01 00 11 00
8F 02 FF FF 01 00 0E 00
Note that characters in positions 3,4,5,6 never change, this is possibly a separator between previous Action and next Action?
7. Then there are "Action" sections that all start with "CMacroStep", followed by the name of the Action being performed. The same "Action" can be repeated in the same macro file.
The listing of these actions appear to depend on the sequence of the actual macro steps. Action titles I have seen so far include the following:
Chars
Command
Replace
Message
Goto
Find
SaveFile
It is obvious that there will be scores more that will be available.
8. Each of these "action" sections seem to include the keys/characters that are entered, such as search/replace strings, filenames to be saved, text characters typed into fields, etc.
9. Sections 6,7,8 are repeated for each "Action" called by the macro.
10. File Footer= (1)character values include? 00/80/02
==========================================
The most confusing section at this point seems to be the eight character sequence in section 6. You may be correct that some of this is a byte count. Part of it may be a trailer from the previous "Action" and/or a header for the next "Action".
==============
By the way, all of this analysis was done using TextPad itself. Making minor changes then using Tools, Compare Files made it easy to pick out modifications.
Hope this helps, it is definitely needed.
What I've found so far
Posted: Thu Apr 03, 2003 4:32 pm
by jeffy
Code: Select all
A First byte: The amount of characters in the NAME.
B Next [value of A] bytes: The NAME.
C Next byte: The amount of characters in the AUTHOR.
D Next [value of C] bytes: The AUTHOR.
E Next byte: The amount of characters in the DESCRIPTION.
F Next [value of E] bytes: The DESCRIPTION
G Next byte: (00 hex) NULL
H Next byte: The number of steps in the macro (there hidden sub-steps, so this number will likely be higher than you expect. For example CMacroStepChars considers every *four characters* a step).
I Next byte: (00 hex) NULL
J Next byte: (FF hex)
K Next byte: (FF hex)
L Next byte: (01 hex)
M Next byte: (00 hex) NULL
N Next byte: Either 0F or 11 (hex)
O Next byte: (00 hex) NULL
P Next bytes:
[If N equals 0F] CMacroStepCommand
[If N equals 11] CMacroStepChars
...and on...
Commands I've found so far:
CMacroStepChars
CMacroStepCommand
CMacroStepReplace
CMacroStepMessage
CMacroStepFind
I'm tired!

Berend!
Posted: Thu Apr 03, 2003 4:36 pm
by jeffy
Man oh man, I should have taken a better look at Berend's findings before I worked so hard.
Oh well. Will try and work further with Berend's findings sometime... Sorry for the duplicated effort. I did lean a lot though!
Posted: Fri Apr 04, 2003 12:09 am
by Bob Hansen
Re Jeffy's inputs:
G is definitely not a NULL. It is a 00 or 01 or 02 depending on how macro is to repeat.
P is defiinitely not based on the value in N. I have identical values in N but different values in P. I believe P is based on Menu Commands, Buttons, etc. Will be doing some more testing in that area.
=========================
Re Berend's inputs:
Where are they? What are they? Why not available for us to review? Multiple minds can solve this as a team.
Posted: Fri Apr 04, 2003 12:40 am
by jeffy__but_I'm_logged_out
Bob Hansen wrote:G is definitely not a NULL. It is a 00 or 01 or 02 depending on how macro is to repeat.
Well, 00
is null. But you're right, 00, 01 or 02.
Bob Hansen wrote:Re Berend's inputs:
Where are they? What are they? Why not available for us to review? Multiple minds can solve this as a team.
There's a link above in this thread.

[/i]
Posted: Fri Apr 04, 2003 2:02 am
by Bob Hansen
More analysis:
I would concur that Jeffy's reference to byte H is probably the number of macro "steps" but the definition of a "step" is still unclear. Each of the "goto" commands below were counted as 1 "step", no additional steps showed up
==============================
Some CMacroStep Command Details:
1. Commanda followed by 02= CTL-HOME
2. Commandb followed by 02= CTL-END
3A. Goto is followed by 6 or 8 bits.
3B. If Bit 5 = 0 or 1, then GoTo is followed by 6 bits of data.
3C. If Bit 5 =2 or 3 or 4, then GoTo is followed by 8 bits of data.
4. Bits 1 and 2 are Hex values for destination, like page number, line number, etc. Format is LSD-MSD, so Decimal 415 (19F Hex) = 9F 01
5. Bit 3 unknown at this time, but all examples so far show=00
6. Bit 4 unknown at this time, but all examples so far show=00
7. Bit 5 is for type of GoTo command. 00=Line, 01=Column, 02=Page, 03=Byte, 04=Bookmark.
8. Bit 6 unknown at this time, but all examples so far show=00
9. Bit 7 unknown at this time, but all examples so far show=01
10. Bit 8 unknown at this time, but all examples so far show=80
Examples:
CMacroStepGoto 0C 00 00 00 00 00 = Goto Line 12
CMacroStepGoto 85 01 00 00 01 00 = Goto Column 389
CMacroStepGoto 05 00 00 00 02 00 01 80 = Goto Page 12
CMacroStepGoto 9F 01 00 00 03 00 01 80 = Goto Byte 415
CMacroStepGoto 0C 00 00 00 04 00 01 80 = Goto Bookmark12
========================
Ready to give up yet?
Texturizer documents how their macros can be edited
Posted: Fri Apr 04, 2003 5:47 pm
by jeffy
http://www.texturizer.net/Texturizer.html#macroedit
Why not TextPad? Even if the documentation is crappy or it's just a source code snippet. Give us something here...!
Who's brave enough to ask?

Posted: Fri Apr 04, 2003 10:27 pm
by Bob Hansen
Jeffy asks:
Who's brave enough to ask?
I am more than willing to ask..
Why not TextPad? Even if the documentation is crappy or it's just a source code snippet. Give us something here...
Hello Helios. Will you please provide a macro editor or the macro file layout as a minimum.
Obviously there are a number of us who are willing to work on this. Rather than forcing us to guess how the macro coding works so we can edit macros, maybe you could choose from one of the following:
Let me see if I can make it simple for Helios and for users.
Helios, please select one from the five choices listed below and let us know your intention.
1. Helios will provide a macro editor by itself, users need to do nothing but be patient.
2. Heliios will be glad to take input from an outside team, and will provide macro file layout details to assist them in solving this problem with Helios.
3. Helios will not create an editor but will provide the macro file layout to help those who want to work on it themselves.
4. Helios will not provide any information on the macro file layout, but wishes everyone good luck.
5. Helios wants all dialog stopped on this subject. This is not important and taking up too much time and space on the forum.
=============================
If I had a vote, I would want you to select option ONE.
Posted: Sat Apr 26, 2003 2:01 pm
by Reint Lange
Hi Bob, et al,
I just became member of the TextPad Community, because I also am very interested in a MacroEditor in Textpad.
I use Textpad for a couple of years now, and found this lead very interesting. ( I also hate re-enter complex-macro-key sequences over and over again!)
I'm programming quite a lot, but usualy stop after reaching the functionality goal. (Mainly little import/export converters for databases and other applictions, mostly in VB6 and sometimes in C)
So if you think you can use an extra couple of "brain-cells" I'm willing to participate.
Of course, we all have limited time to spend in our busy schedules...
Now tere's a feature request with vote for this
Posted: Sat Apr 26, 2003 3:37 pm
by skaemper
I just posted my opinion on this over at
http://www.textpad.com/forum/viewtopic.php?t=3775
Now, community members could you please go & vote? And comment on my posting of course.
Cheers
Stephan
Editing macros (again? finally again!)
Posted: Sat Jun 21, 2003 12:42 pm
by aanway
Everybody,
I’m sorry to have not responded before now. The contributions from (
thank you!) Jeffy, Bob, and Berend posted to the forum provided a lot of new insights, and have
really helped. With a variety of (mostly consistent) conclusions to consolidate, vacations, business trips, and, of course, lots of procrastination, it has taken until now to present the
**updated** project information found at Jeffy’s site (
http://www.jeffyjeffy.com/code/textpad/ ... index.html).
Thanks, especially, to two readers who wrote analysis packages of their own, Berend Velkamp and George Schizas.
Berend’s package was written in Delphi and he posted a link at this TextPad forum (
http://www.textpad.com/forum/viewtopic.php?t=3302) to it on his website (
http://home.tiscali.nl/~bveldkamp/tpm/).
I also received email from George Schizas, who wrote a package in VB .NET, which is at
http://www.jeffyjeffy.com/code/textpad/ ... DotNet.zip. Note that this package requires the .NET runtime to be installed on your machine. It is a command-line application, requiring a filename argument (the name of the macro file to be analyzed).
The presentation at Jeffy’s website has
finally been updated, and the areas needing more information are flagged
in red. If you are inspired by the partial picture presented there, and want to explore a red area, please either post your insights here at the forum or drop me an email. Most of the unknown areas should be resolvable with a little direct testing (insert the macro step, take the unknown action and observe the results). Now that we have an organized structure to the analysis, revisions can occur much more quickly!
Al Anway
(please note anti-spam tweak in address: aanway@forward_delete_underscore_part_.to)