Texpad 4.7.1 Unexpectedly quits

General questions about using TextPad

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

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

Post by mo »

Hum... I went over it again, I was able to reproduce the problem. I see only one step I left out which was one step of the "editing" routine (the last bit, backspace...:

going to the end of the file, place a comma at the second to the last line, press enter which creates a blank line,
select this blank line and use the delete key to delete it,
select the last line and use the delete key to delete it,
backspace back to after the comma on the line that remains,
Save the file, etc.

One more bit of info: This is happening whether or not I save the file before I do the editing routine or after. That is as long as I do the editing routine. If I simply save the program after running the macros and close and reopen, no problem.
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 »

I see a lot has been going on since I was here last.

:arrow: 1. I use Macro Scheduler with TextPad constantly, have reviewed the MS code, and am 100% sure that is not contributing to the problem. All it is doing is a simple CTL-V paste operation.

:? 2. I followed all the steps detailed to duplicate the problem, and came up with no problem at all, no extra characters. Hmmm, what font are you using? I am using Courier New, Regular, 10. Western script.

:idea: 3. I have visible characters on, and am sure that I was deleting the last lines, etc. I wonder if it is possible that you may have extra lines that you don't see.....be sure to keep visible characters turned on.

:?: 4. Re the Undo, you provided no steps or examples of when that is done, but I wonder how you are executing that? Using the menu, Edit, Undo, or pressing CTRL-Z?

:idea: 5. Is it possible that you have another function tied to CTRL-Z in addition to Undo? Is it possible that another hot-key combination is tied to FileExit? Check out Configuration, Preferences, Keyboard settings. Review your macros, make sure you aren't using a hot-key to call a macro that does FileExit. Make sue no Tool is being called that might cause File Exit. No macro should be calling ALT-F4 which will also quit TextPad.
Hope this was helpful.............good luck,
Bob
mo
Posts: 306
Joined: Tue Mar 11, 2003 1:40 am

Post by mo »

1. I use Macro Scheduler with TextPad constantly, have reviewed the MS code, and am 100% sure that is not contributing to the problem. All it is doing is a simple CTL-V paste operation.
Bob, I suspect you are correct, but the code above is not the only code in the macro being used. Below is the entire script which you may remember was actually mostly written by you.

Code: Select all

//
//Variables
//
Let>WW_TIMEOUT=5
Let>WindowName=TextPad*
Let>FileName=F:\All Webs\Buddha Dust\BuddhaDust\backmatter\glossology\edit4keywords_temp.txt
CapsOff

//Run program and wait for it to be active
Change Directory>E:\Program Files\TextPad 4
Run Program>E:\Program Files\TextPad 4\TextPad.exe
WaitWindowOpen>%WindowName%
SetFocus>%WindowName%
Wait>1

//Paste from Clipboard
Press CTRL
Send>v
Release CTRL
Wait>1

//Select All
Press CTRL
Send>a
Release CTRL

//Move All to Left Margin (4 back tabs)
Press Shift
Press Tab *4
Wait>3

//Go to Beginning of First Line of text.
Press CTRL
Press Home
Release CTRL

//Run TP 'Strip Tags' Macro ALT+MS
Press ALT
Send>MS
Release ALT
Wait>3

//Go to Beginning of First Line of text
Press CTRL
Press Home
Release CTRL

//Run TP "Remove Blank Lines" macro ALT+MD
Press ALT
Send>MD
Release ALT
Wait>3

//Save As edit4keywords_temp.txt
Press ALT
Send>fa
Release ALT
WaitWindowOpen>Save As
Wait>0.16
Send>%FileName%
Wait>1.5
Press Enter
Wait>1.5
//OK Replace file
Press CTRL
Wait>0.5
Send>y
Wait>0.5
Release CTRL
2. I followed all the steps detailed to duplicate the problem, and came up with no problem at all, no extra characters. Hmmm, what font are you using? I am using Courier New, Regular, 10. Western script.
I am using Courier New, Regular 12pt. Western script. For both .htm and .txt files. The fact that you and MudGuard cannot reproduce the problem may point to the OS.
3. I have visible characters on, and am sure that I was deleting the last lines, etc. I wonder if it is possible that you may have extra lines that you don't see.....be sure to keep visible characters turned on.


I have visible characters on in all categories. There are extra lines, but I backspace out of them.
4. Re the Undo, you provided no steps or examples of when that is done, but I wonder how you are executing that? Using the menu, Edit, Undo, or pressing CTRL-Z?
The "undo" is being done with the "undo" button, at the time when the odd characters first show up which is after inserting a comma after the next to the last line and after deleting the last line of text. But as I said, in reproducing the problem the "undo" is not an issue...I wanted to keep MacroScheduler out of the picture, and I am relatively sure that the sudden close is a result of the undo from TextPad undoing the original creation of the file by MS. (Why/how is another issue).
5. Is it possible that you have another function tied to CTRL-Z in addition to Undo? Is it possible that another hot-key combination is tied to FileExit? Check out Configuration, Preferences, Keyboard settings. Review your macros, make sure you aren't using a hot-key to call a macro that does FileExit. Make sue no Tool is being called that might cause File Exit. No macro should be calling ALT-F4 which will also quit TextPad.
I checked the key bindings and there were no conflicts. The Macros as you can see from the code use "ALT+"...and were actually set up according to your instructions.

EDIT PS: Worth noting again: this is on a machine where the OS was clean installed, TextPad was clean installed, and MS was clean installed, where the Motherboard and CPU and RAM are new and where there is plenty of RAM and disk space; while the problem occured on the old setup as well.
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 »

Reviewing the Macro Scheduler code, I see a few items to point out.
//Move All to Left Margin (4 back tabs)
Press Shift
Press Tab *4
Release SHIFT
Wait>3
Need to Release the SHIFT key where shifting code to the left:
//Run TP 'Strip Tags' Macro ALT+MS
Press ALT
Send>MS
Release ALT
Press ENTER
Wait>3
The ALT MS will only work if the Strip Tags macro has the S underlined to function as an accelerator key. If this is not a TextPad accelerator key, then you need to add "Enter" as shown in the macro. To make the "S" active, edit the macro display name to be "&Strip Tags" (without the quotes). In that case, Enter is not needed.
//Run TP "Remove Blank Lines" macro ALT+MD
Press ALT
Send>MD
Release ALT
Press ENTER
Wait>3
The macro to Remove Blank Lines is being activated with ALT M,D but I see no letted "D" in the macro name. If this is not a TP accelerator key, then you need to add "Enter" as shown in the macro. If another letter has the underline, then that letter should replace the D. To make the "R" active, edit the macro display name to be " &Remove Blank Lines" (without the quotes). This will make "R" an accelerator key and in that case, "Enter" is not needed, use Send>MR vs. MD

I suspect this third area is the cause of your problem. If your "Remove Blank Lines" macro does not have an Accelerator Key "D", then this macro is not actually running. Blank Lines are not being removed. If you want to check this out, you can single step Macro Scheduler and watch the results. If you need help to do that, let me know.
Hope this was helpful.............good luck,
Bob
mo
Posts: 306
Joined: Tue Mar 11, 2003 1:40 am

Post by mo »

OK Bob, I'll add the release shift for the moves right, but the other two are already set up with these accelerator codes.
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 »

the other two are already set up with these accelerator codes.
You have an accelerator key "D" for the macro "Remove Blank Lines"?
Where is the letter "D" in the display name for the macro? :?:

Here is the macro section you submitted:
//Run TP "Remove Blank Lines" macro ALT+MD
Press ALT
Send>MD
Release ALT
Wait>3
Your macro code is
1. Pressing the ALT key,
2. then pressing the letter M which will open the Macro drop down list,
3. then pressing the letter D which will do what?

Another way this could be written, with some delays:
Press ALT
Send>M
Wait>1
Send>D
Wait>1
Release ALT
I'm not suggesting you change your code, but show this to help you understand what is happening. Keystrokes are being sent just as if you were typing.

:arrow: The letter D is only going to run the Remove Blank Lines macro if it has the accelerator key "D". Also look on the Macro drop down list to make sure accelerator key "D" is not already assigned. Pressing "D" will go to the first incident if you have multiple "D" accelerators listed. If more than one, then need to modify macro to Send>D multiple times until the correct one is selected.

:idea: But I suspect you have a different accelerator key from "D", probably "R"? In that case change the macro to:
//Run TP "Remove Blank Lines" macro ALT+MR
Press ALT
Send>MR
Release ALT
Wait>3
Hope this was helpful.............good luck,
Bob
mo
Posts: 306
Joined: Tue Mar 11, 2003 1:40 am

Post by mo »

OK, I apparently misunderstood your instructions when first setting up that script in that I thought we were giving the TextPad macros a two-letter "key" "MD" (The confusion came in from one that I still do not understand, where the two letters were "TU". In any case I changed the accelerator key to simple "D" and simple "S". (You need to understand that these were to my eye working the other way, however that happened).

Now running the script I see that "Delete Blank Lines" has in fact deleted all blank lines, but that if you close this file and re-open it, TP is saving it with a blank line at the end...I do have "Strip trailing spaces from lines when saving" checked.

Doing this manually, not using MS, the same thing happens, but the odd characters do not now appear. Hopeful.

I believe there is another thread here which is complaining about lines at the end of the file, I don't know if this is that issue.

I can't be sure until I use the script now for a while to see if this has solved the problem, but I suspect not given the blank line at the end.

EDIT 1: Ok tried this a few times and in fact an odd character is still being inserted at the end of the file now and again (this time a cap U with an accent + the blank line). And, additionally, I can undo this file into extinction. I don't understand how I can do that. You can't normally Undo the creation of a file I don't think, and Macro Scheduler isn't even running at the time. Does TextPad think that all this is happening to the original file perhaps?

Thanks for all the help,

yours in guilt and utter blamability,
Best Wishes!
Mike Olds
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

>>Now running the script I see that "Delete Blank Lines" has in fact deleted all blank lines, but that if you close this file and re-open it, TP is saving it with a blank line at the end...I do have "Strip trailing spaces from lines when saving" checked.

Do you have Configure - Preferences - Editor - Automatically terminate last line checked?
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Do you have Configure - Preferences - Editor - Automatically terminate last line checked?
NO
Hope this was helpful.............good luck,
Bob
mo
Posts: 306
Joined: Tue Mar 11, 2003 1:40 am

Post by mo »

High blood pressure Bob?

Actually I didn't have it checked. And checking it doesnt alter the previous information...a blank line is added after saving.
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 »

My other responses were so long, I thought I would emphasize the brevity. :oops:

And now I see where your "D" came from. The macro sample you supplied referenced a macro "Remove blank lines." I just checked my TP macro and it is named "Delete blank lines." Suggest maybe changing the reference in your MS script?
========================

To help troubleshoot this, let me suggest that you add a Goto> line before you save the file. Check to see if that extra blank line is there. Then finish up manually.
//Run TP "Remove Blank Lines" macro ALT+MD
Press ALT
Send>MD
Release ALT
Wait>3
Goto>End

//Save As edit4keywords_temp.txt
...
...
Label>End
And you might also add a keystroke delay that I have found helpful to fight possible race conditions:
Let>SK_DELAY=5
The default value = 0. Add this line to the beginning of you Macro Scheduler script with your caps off/on
Hope this was helpful.............good luck,
Bob
mo
Posts: 306
Joined: Tue Mar 11, 2003 1:40 am

Post by mo »

A parallel occurs to me concerning the ability to use the "undo" key to back out of the creation of the file: it's like when you make some changes to a line of text, select that line of text, copy it, then use undo to go back to the original line...you can't back out of the saved text in the clipboard, it's still there no matter how far back you "undo."

EDIT:

What can I say? this happened on a document I just finished working on. It occured exactly as described above, just after placing a comma at the end of the second-to-the-last line, and deleting the last line. Replacing the last line that was deleted was the code below (without the note about null code, which was the message I got when I tried to copy the code..."0s" substituted for the square box "null" codes.

Code: Select all

cannot cut, copy or drag and drop text containing null code characters

ccess to Insight:00n00000000^¬0/0000000000000000
I then copied the text of what remained so that I would not loose the work and closed the file without doing any of the "undo" routine.

Re-opening the file the same code is there, only now on a separate line from the "ccess to Insight:" portion (that was the end portion of the original last line.

The re-opened file of course had nothing to "undo" and I was able to delete the code without problems.

I repeated the process 4 more times with the same copied text without the problem occurring.
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 »

1. OK, so that seems to eliminate Macro Scheduler.

2. It almost sounds like some type of error code. And reading it makes me wonder if the data being pasted into the document may include invisible null codes? That message says that null characters cannot be cut, so what you are seeing is the result of those null characters.

3. And this is only happening when you paste certain data into TextPad, right? It does not happen with every thing you paste, only this certain group of files?

4. Any way to check the source file being pasted to see if null codes exist? Any to strip out null codes before pasting into TextPad.

It sounds like you are real close at this point.
Hope this was helpful.............good luck,
Bob
mo
Posts: 306
Joined: Tue Mar 11, 2003 1:40 am

Post by mo »

Hello Bob,

I don't feel close!

I don't think there is anything strange in the original files which are from two different sources, but both .htm and originally created in TextPad. I always make sure when I am selecting and copying the original text that I select whole blocks of code...no open ends.
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 »

Mike, send me a copy of the original files that you are doing the cut and paste with. I think you already have my email address.

(WE NEED PRIVATE MESSAGING activated) PLEASE!

Can you also provide a clarification on your comments about inserting a comma on the line above the last one. Even if it is blank? Maybe provide example of last 5 lines showing "before" and "after" comma insert. Maybe use color to show the lines that are deleted?
Hope this was helpful.............good luck,
Bob
Post Reply