Editing macros (again? again!)
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Editing macros (again? again!)
All right, already. Enough people have complained about TextPad's poor macro behavior. See the following links:
http://www.textpad.com/forum/read.php?f=1&i=0283&t=0185
http://www.textpad.com/forum/read.php?f=1&i=1199&t=1187
http://www.textpad.com/forum/read.php?f=1&i=1367&t=1350
http://www.textpad.com/forum/read.php?f=1&i=1947&t=1698
http://www.textpad.com/forum/read.php?f=1&i=2213&t=2163
http://www.textpad.com/forum/read.php?f=1&i=2410&t=2409
http://www.textpad.com/forum/read.php?f=1&i=2713&t=2687
http://www.textpad.com/forum/read.php?f=1&i=2917&t=0707
http://www.textpad.com/forum/read.php?f=1&i=3670&t=3669
http://www.textpad.com/forum/read.php?f=1&i=3828&t=3825
http://www.textpad.com/forum/read.php?f=1&i=4364&t=2962
Let's take matters into our own hands and determine the format of the macro files. Once we understand the content of the files, we can create a tool that will enable viewing of a created macro, and then make a tool that will enable modification of a created macro. Please see my description of this project at http://www.jeffyjeffy.com/code/textpad/ ... index.html and join the fun.
Al
http://www.textpad.com/forum/read.php?f=1&i=0283&t=0185
http://www.textpad.com/forum/read.php?f=1&i=1199&t=1187
http://www.textpad.com/forum/read.php?f=1&i=1367&t=1350
http://www.textpad.com/forum/read.php?f=1&i=1947&t=1698
http://www.textpad.com/forum/read.php?f=1&i=2213&t=2163
http://www.textpad.com/forum/read.php?f=1&i=2410&t=2409
http://www.textpad.com/forum/read.php?f=1&i=2713&t=2687
http://www.textpad.com/forum/read.php?f=1&i=2917&t=0707
http://www.textpad.com/forum/read.php?f=1&i=3670&t=3669
http://www.textpad.com/forum/read.php?f=1&i=3828&t=3825
http://www.textpad.com/forum/read.php?f=1&i=4364&t=2962
Let's take matters into our own hands and determine the format of the macro files. Once we understand the content of the files, we can create a tool that will enable viewing of a created macro, and then make a tool that will enable modification of a created macro. Please see my description of this project at http://www.jeffyjeffy.com/code/textpad/ ... index.html and join the fun.
Al
Re: Editing macros (again? again!)
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
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!)
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
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
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
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......
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......
Last edited by Bob Hansen on Mon Aug 25, 2003 3:48 pm, edited 1 time in total.
Hope this was helpful.............good luck,
Bob
Bob
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
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.
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.
Hope this was helpful.............good luck,
Bob
Bob
What I've found so far
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
Berend!
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!
Oh well. Will try and work further with Berend's findings sometime... Sorry for the duplicated effort. I did lean a lot though!
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
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.
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.
Hope this was helpful.............good luck,
Bob
Bob
Well, 00 is null. But you're right, 00, 01 or 02.Bob Hansen wrote:G is definitely not a NULL. It is a 00 or 01 or 02 depending on how macro is to repeat.
There's a link above in this thread. [/i]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.
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
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?
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?
Last edited by Bob Hansen on Thu Oct 08, 2009 8:01 pm, edited 1 time in total.
Hope this was helpful.............good luck,
Bob
Bob
Texturizer documents how their macros can be edited
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?
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?
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
Jeffy asks:
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.
I am more than willing to ask..Who's brave enough 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.
Hope this was helpful.............good luck,
Bob
Bob
-
- Posts: 1
- Joined: Sat Apr 26, 2003 1:35 pm
- Location: The Netherlands
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...
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
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
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
"It's POLYMORPHIC!"
A former colleague
A former colleague
Editing macros (again? finally again!)
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)
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)