Edit file for Keywords setup

Hints, tips and tricks for newbies

Moderators: JRL, Dorian Ellis

Edit file for Keywords setup

Postby mo » Sun Aug 31, 2003 2:57 am

Hello,

I have put on hold for the moment my attempt to get the Ad-aware macro working. However, attempting to convert this little script from a recorded macro to all keystrokes, which should be possible (I am using TextPad), is looking very much like the problems I am having with the Ad-aware macro.

I have annotated the script as best as I understand, and would appreciate the word of an experienced eye as to what may be going wrong here:

====================================


//edit4keywords.0.0001.scp
//Saturday, August 30, 2003 3:48 PM
//Created by mo mikeolds@buddhadust.org
//Takes copied text from html formatted pages; pastes to new file;
//moves all copy to the left margin; removes all html tags (using
//TextPad Macro 'Strip Tags'); removes all blank lines(using TextPad
//Macro 'Delete Blank Lines'); removes all extra spaces(using
//TextPad Macro 'Remove all'air''); saves the file as
//F:\Program Files\MacroScheduler\Macro Scheduler
//Pro\bin\edit4keywords_temp.txt (replacing previous save)
//
//
//Variables
//
Let>WW_TIMEOUT=5
Let>WindowName=TextPad*
Let>FileName=E:\All Webs\Buddha Dust\BuddhaDust\backmatter\glossology\edit4keywords_temp.txt
//Need here:
//How to start the Macro Focused On the Active Document in TextPad,
//?SetFocus>%WindowName%
//?Press CTRL
//?Wait>0.5
//?Send>fn
//?Wait>0.5
//?Release CTRL
//?Wait>0.5
//?Open a New File
//Run program and wait for it to be active
Change Directory>F:\Program Files\TextPad 4
Run Program>F:\Program Files\TextPad 4\TextPad.exe
WaitWindowOpen>%WindowName%
SetFocus>%WindowName%
Wait>1
//Paste from Clipboard
Press CTRL
Wait>0.5
Send>v
Wait>0.5
Release CTRL
Wait>0.5
//Select All
Press CTRL
Wait>0.5
Send>a
Wait>0.5
Release CTRL
Wait>0.5
//Move All to Left Margin (4 back tabs)
Press Shift
Wait>0.5
Press Tab *4
Wait>2.5
//Go to Beginning of First Line of text.
//This works in a recorded macro, but doing it with
//keystrokes only it does not go to the beginning of
//the first line, it selects the first line.
//I think this is the source of the problems with
//the first macro, as it need the cursor to be at
//the beginning of the first line.
Press CTRL
Press Home
Release CTRL
Wait>0.5
//Run TP 'Strip Tags' Macro Ctl+T (or t)
//This doesn't work: It goes to the correct macro, and clicks, but
//the macro doesn't work
//Press ALT
//Wait>0.5
//Send>M
//Wait>0.5
//Release ALT
//Wait>0.5
//Press Down *13
//Wait>0.5
//LClick
//Wait>0.5
//This doesn't work
//Press CTRL
//Send>T
//Release CTRL
//Wait>5
//This works:
MouseMove>364,48
Wait>0.5
LClick
Wait>0.5
MouseMove>432,381
Wait>0.5
LClick
Wait>0.5
//Go to Beginning of First Line of text
Press CTRL
Press Home
Release CTRL
Wait>0.5
//Run TP 'Remove Blank Lines' Macro Ctl+Q (or q) This appears to be
//redundant with the 'remove air' macro But it didn't work this way:
//Press CTRL
//Wait>0.5
//Send>Q
//Wait>0.5
//Release CTRL
//Wait>5
//This works this way:
//MouseMove>370,51
//Wait>0.5
//LClick
//Wait>0.5
//MouseMove>460,406
//Wait>0.5
//LClick
//Wait>0.5
//Go to Beginning of First Line of text
Press CTRL
Press Home
Release CTRL
Wait>0.5
//Run TP 'Remove 'air'' Macro Ctl+W (or w) This doesnt work this way:
//Press ALT
//Wait>0.5
//Send>M
//Wait>0.5
//Release ALT
//Wait>0.5
//Press Down *15
//Wait>0.5
//LClick
//Wait>0.5
//This doesn't work this way either
//Press CTRL
//Send>W
//Release CTRL
//Wait>5
//This way works:
MouseMove>371,53
Wait>0.5
LClick
Wait>0.5
MouseMove>419,433
Wait>0.5
LClick
Wait>0.5
//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
Wait>0.5
//Need here:
//1. Exit MacroScheduler (not Textpad File);
//2. Pause MacroScheduler to allow editing of file, then continue with
//further routines: Sort list, pause to remove duplicates, run search
//and replace to add commas to the end of each word, run search and
//replace to delete double commas at the end of each word, sort again,
//join all words (CTRL+SHIFT+J), backspace twice to place cursor at
//the end of the line and remove the final comma, select all, copy,
//terminate script, close %FileName%


========================
Best Wishes!
mo
mo
Junior Coder
 
Posts: 49
Joined: Thu Aug 21, 2003 11:02 pm

Postby Bob Hansen » Sun Aug 31, 2003 5:27 am

I have copied your script and will look at it when I can.

Can you submit a sample or a portion of the "edit4keywords_temp.txt" file that you are trying to parse and save?

Do you want to start Macro Scheduler macro after TP is opened with file loaded? OR
Do you want Macro Scheduler macro to open TP and load the file, process and save the text file, and then Stop the Macro fpr you to do additional work, or pause the macro and restart by itself after some condition is met?

"Further routines" can most likely be done by Macro Scheduler also vs. TP.
But let's get this part settled first..................

Stay tuned................
User avatar
Bob Hansen
Automation Wizard
 
Posts: 2448
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US

Postby Bob Hansen » Sun Aug 31, 2003 5:43 am

My copy of TextPad did not have the macros loaded for "Delete Blank Lines" or for "Strip Tags" so I added them to my Macro Listing.

But I cannot find any reference to "'Remove all air''. Is this a macro that you created or downloaded? Can you point me to a source for the macro file, or provide a copy?

You might also consider using Macro Scheduler to do the TP macros. That way you can edit them, pause them, have more overall control. Perhaps not with this script, but keep it in mind for future.

Also, what version of TP are you using? I am using 4.7.0. I have not loaded 4.7.1 yet. Despite the initial words of praise with the beta version, I am waiting to see more responses to the final realease that just happened. Any special configuration settings I need to know about to simulate your copy?

I can do most of this without waiting for answers, but the info would help provide a more accurate and sensible solution.

Thanks....................
Bob
User avatar
Bob Hansen
Automation Wizard
 
Posts: 2448
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US

Postby Lumumba » Sun Aug 31, 2003 8:03 am

For those who don't use an editor like TextPad or UltraEdit:

You don't have to eliminate HTML Tags if you paste a text copied from a web page to notepad (a plain ASCII editor).

---

The CommandLine Commando (to be used with MScheds Run Program>)

The CommandLine Commando is the first release of a growing collection of FreeWare Utilities for Windows 9X/NT.

These utilities include many filters and other text processing commands as well as file and text search utilities.

The WIN9X/NT filters
--------------------

Trim | trim trailing blanks from each line in a file.

Onespace | removes extra blank lines from a file.

Basename | gets basename from filename.
Decho | echoes standard input to screen (great for debugging).
Dict | puts each word of a file onto a separate line.
Lcase | translate all uppercase characters to lowercase.
Numbey | number all the lines in a file.
Pad | pad each line in a file to a fixed length.
Strip | create comments file from a c source code file.
Sub | replace one string with another throughout a file.
Sum | add columns of numbers from a redirected file.
Truncate | truncates a line at first matching char (or space).
Ucase | translate all lowercase characters to uppercase.
Uniq | deletes multiple occurances from a sorted list.
Untab | expand all tabs in a file to blanks.
Unws | translate a wordstar document to plain text.
Xtodos | translate Unix text or Apple Text to DOS text.

The WIN9X/NT "almost filters" and utilities
-------------------------------------------

Bingrep | a grep (text search) for binary files.
Ffeed | reads a filespec and sends files to standard output.
Grabasc | a tsr ascii text screen capture utility.
Hexval | create character arrays from binary files.
Idiff | compare 2 textfiles and report differences.
Igrep | a grep (text search) for text files.
Longtext | remove wordwrap from textfiles (DOS to Windows Text).
Mloc | count lines in text files and report totals.
Modeget | get video mode.
Modeset | set video mode.
Newfiles | create list of files modified after specified date.
Pipecon | pipe the console to a diskfile.
Touch | modify file dates and times.
Txt2pcx | convert ascii text to monochrome .PCX image.
Unfeed | undo a lumped file created by ffeed into single files.
Whereis | search the harddisk for files specified.
Which | search the environment for the specified file.
Wraptext | add wordwrap to textfiles (Windows to DOS Text).
Yesno | batchfile extension to allow yes/no questions.[/b]
Lumumba
 

Postby mo » Sun Aug 31, 2003 11:23 am

OK, Here goes!

TextPad 4.7.1, on W2KPro, ANSI, PC, default setup using word-wrap, Save with no breaks in lines, strip trailing spaces when saving, syntax highlighting

1. Here is a sample bit of representative of the text being copied and pasted (there is often an additional several paragraphs of discussion etc, but this section has the tabs that need to be removed).
The objective is to end up with a file that can be edited down to the important words found on that page. This is not copied from the web, this is copied off the file opened in TextPad.
====================================================


In the context of the Satipatthana Sutta:




Pali
MO
Nyanasatta Thera
Soma Thera
Hare
Horner
Punnaji
Nanamoli/ Bodhi
T. W. and C.A.F. Rhys Davids
Thanissaro
Walshe
Woodward


dhamma
Dhamma (the Word), thing, object
mental objects
mental objects

mental objects
thought
mind-objects
ideas
mental qualities
mind-objects


==========================================================

2. The macro you are missing can be found at:

http://www.textpad.com/add-ons/macros.html
under "Reformating" and is called parajoin and has several macros in the package. The one you want is 'remoair' -- installed it is listed as rem&oair with the title "remove all 'air'".

I think this one is better than the remove blank lines macro for this case.

A little further into the game I will most likely use MS to create my own macros, but for now I need to keep this as simple as possible ... which may be making it more complicated!

============================================================

Do you want to start Macro Scheduler macro after TP is opened with file loaded? OR
Do you want Macro Scheduler macro to open TP and load the file, process and save the text file, and then Stop the Macro fpr you to do additional work, or pause the macro and restart by itself after some condition is met?


1. Yes I want to start MS after TP is opened with file loaded and the bit to be edited already copied to the clipboard.
2. Then I want MS to open a new page and paste from the clipboard (I don't want it working on the opened file directly ... obvious, but just to be clear.)
3. The follow up notes were really to myself as I don't expect anyone to be writing my whole script and I had not looked up any part of what was involved in: halting the MS macro temporarily to allow me to do some work on the file, restarting the macro to perform some other routines, possibly doing this stop/start thing several times.

(My background is in computerized phototypesetting ... worked in a publishing house in NY that used the first phototypesetting machine at Kingsport Press (Tenn), (size of a large room) then had my own setup (size of a large desk) and was put out of business by these infernal things they called Apples! (size of a TV) that could do the job, and do it almost as well (quality of final type has never caught up with the Kingsport version). Point being, that these early machines had keys setup where we could set up little routines, pause them, add data, restart them, etc., and I have never found a way to do that on the computer...and MS looks like the way.)
Best Wishes!
mo
mo
Junior Coder
 
Posts: 49
Joined: Thu Aug 21, 2003 11:02 pm

Postby Bob Hansen » Sun Aug 31, 2003 6:35 pm

Got the macro package, thanks.......
User avatar
Bob Hansen
Automation Wizard
 
Posts: 2448
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US

Postby Bob Hansen » Mon Sep 01, 2003 2:15 am

Just finished my modifications of your macro. Used all keystrokes, no mouse movements. Results from your sample are shown here:

In the context of the Satipatthana Sutta:
Pali
MO
Nyanasatta Thera
Soma Thera
Hare
Horner
Punnaji
Nanamoli/ Bodhi
T. W. and C.A.F. Rhys Davids
Thanissaro
Walshe
Woodward
dhamma
Dhamma (the Word), thing, object
mental objects
mental objects
mental objects
thought
mind-objects
ideas
mental qualities
mind-objects


If this looks right, I will submit my version for your review. Process ran instantly, TextPad is still open waiting to be used.

Hope this is what you wanted...................good luck,
Bob
User avatar
Bob Hansen
Automation Wizard
 
Posts: 2448
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US

Postby mo » Mon Sep 01, 2003 5:45 pm

Bob,

This looks right. Sorry if this reply is late, somehow I got logged out and it didn't look like there was any response here when I gave it periodic quick checks.

I would like to see what you have done.
Best Wishes!
mo
mo
Junior Coder
 
Posts: 49
Joined: Thu Aug 21, 2003 11:02 pm

Postby Bob Hansen » Mon Sep 01, 2003 9:00 pm

Hi mo......

Here is my modified version of your script:

//edit4keywords.0.0001.scp
//Saturday, August 30, 2003 3:48 PM
//Created by mo mikeolds@buddhadust.org
//Takes copied text from html formatted pages; pastes to new file;
//moves all copy to the left margin; removes all html tags (using
//TextPad Macro 'Strip Tags'); removes all blank lines(using TextPad
//Macro 'Delete Blank Lines'); removes all extra spaces(using
//TextPad Macro 'Remove all'air''); saves the file as
//F:\Program Files\MacroScheduler\Macro Scheduler
//Pro\bin\edit4keywords_temp.txt (replacing previous save)
//
Label>BobNotes
//Use Main Menu and keystrokes to activate macros vs. Mouse Moves.
//Can use ALT-M and up/down arrows, but macro will not always be in same menu position, so make ALT keys for TP macros.
//In TextPad, make ALT Key for macros. In Configure, Preferences, Macros:
//Highlight the macro name, click on Properties. In the filed for display Name, enter "&" (without the quotes) before the key for ALT action.
//For "Delete all lines" change to "&Delete all lines, use ALT-MD.
//For "Strip tags", change to "&Strip tags", use ALT-MS
//Remove "air" already has ALT-o as an option. Use ALT-Mo.
//Note TP sensitivity to Case with ALT/CTRL macro commands.


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

//Need here:
//How to start the Macro Focused On the Active Document in TextPad,
//?SetFocus>%WindowName%
//?Press CTRL
//?Wait>0.5
//?Send>fn
//?Wait>0.5
//?Release CTRL
//?Wait>0.5
//?Open a New File
//Run program and wait for it to be active

Change Directory>F:\Program Files\TextPad 4
Run Program>F:\Program Files\TextPad 4\TextPad.exe
WaitWindowOpen>%WindowName%
SetFocus>%WindowName%
Wait>1

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

//Select All
Press CTRL
//Changed to Upper Case, TP can be sensitive to Case
Send>A

Release CTRL

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

//Go to Beginning of First Line of text.
//This works in a recorded macro, but doing it with
//keystrokes only it does not go to the beginning of
//the first line, it selects the first line.
//I think this is the source of the problems with
//the first macro, as it need the cursor to be at
//the beginning of the first line.
//Note that single stepping MS macros with ALT/CTRL commands may give unexpected results. I have found that I sometimes need to go to controlled application and manaully enter the ALT-CTRL commands. But this code does work OK in running macro.
Press CTRL
Press Home
Release CTRL

//Run TP 'Strip Tags' Macro Ctl+T (or t)
Press ALT
Send>MS
Release ALT
//My keyboard is set for CTL-T to do "Edit Transpose", not to run "Strip Tags"


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

//Run TP 'Remove Blank Lines' Macro Ctl+Q (or q) This appears to be
//redundant with the 'remove air' macro But it didn't work this way:
//My modifications include both macros because I did not understand your needs, and running both may not be redundant. That would be your call.
Press ALT
Send>MD
Release ALT
//My keyboard is set for CTL-Q to do "undefined", not to run "Delete Blank Lines"


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

//Run TP 'Remove 'air'' Macro Ctl+W (or w) This doesnt work this way:
Press ALT
Send>Mo
Release ALT
//My keyboard is set for CTL-W to do "Word Right", not to run "Remove Air"


//Save As 'edit4keywords_temp.txt
Press F12
WaitWindowOpen>Save As*
Send>%FileName%
Press Enter
//Replace existing file
Press Left
Press Enter
WaitWindowClosed>Save As*


//Need here:
//1. Exit MacroScheduler (not Textpad File);
//2. Pause MacroScheduler to allow editing of file, then continue with
//further routines: Sort list, pause to remove duplicates, run search
//and replace to add commas to the end of each word, run search and
//replace to delete double commas at the end of each word, sort again,
//join all words (CTRL+SHIFT+J), backspace twice to place cursor at
//the end of the line and remove the final comma, select all, copy,
//terminate script, close %FileName%


It looks like you are getting a handle on Macro scheduler now. The major changes I introduced for you were using Keyboard vs. Mouse. Also, my past experience with TP and its sensitivity to ALT/CTRL keys in macros. Wait> is usually not needed, but can be inserted as needed to fine tune "race conditions". Whenever I see that need, it is usually after Press ALT/CTRL and Send> Commands.

Thanks also for the TP macro scripts in parajoin.zip. Gerrit Kears did a good job of documenting his TP macros in the readme files. You could cut/paste them into Macro Scheduler. Then change the syntax as needed to eliminate calling the TP macros.

Hope this was helpful......................good luck,
Bob
User avatar
Bob Hansen
Automation Wizard
 
Posts: 2448
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US

Postby mo » Mon Sep 01, 2003 9:19 pm

Thanks Bob,

I'll get right to work on this...let you know when I mess up the next step!

For the strip tags, there is a regex that should do it, but my regex know-how is about as strong as my scripting know-how...

Find and delete (delete I can manage).
Best Wishes!
mo
mo
Junior Coder
 
Posts: 49
Joined: Thu Aug 21, 2003 11:02 pm

Postby Bob Hansen » Mon Sep 01, 2003 10:00 pm

I started self teaching myself on Reg Ex this past year. I now find myslef answering questions for others on this subject, but still have a lot to learn.

Excellent book is "Regular Expressions", 2nd edition, by Jeffrey Friedl, published by O'Reilly Press, copyright 2002, about $40.

Opens up a whole new world of Search methods. Be sure not to get the earlier edition.
User avatar
Bob Hansen
Automation Wizard
 
Posts: 2448
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US

INTERMEDIATE RESULTS

Postby mo » Mon Sep 01, 2003 11:11 pm

Hello Bob,

After a few blunders I have managed to get this to work with a couple of changes and one question.

I am embarased to ask the question! But in your instructions for setting up ALT keys for TextPad Macros, you say

Highlight the macro name, click on Properties. In the filed for display Name, enter "&" (without the quotes) before the key for ALT action.
//For "Delete all lines" change to "&Delete all lines, use ALT-MD.


Which I can read (and have tried) two ways: as changing the name to read:

Remove Blank Lines,ALT-MD
or
Remove Bland (Blank!...that would be some useful macro!) Lines,use ALT-MD

The current working version is using the latter, much to my astonishment, but I am wondering if that is just because TextPad is being nice and ignoring my "use"; and if the times I used it the other way didn't work because of other reasons.

The other thing is that I could not get the file to save using your file saving code, and reverted to the one I had previously.

I also stripped out all the comments as they were starting to get me crazy.

99% your code; works just like that! [snap fingers] (tried it twice on some much more complicated test material than I posted for you):

=========================================


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

Change Directory>F:\Program Files\TextPad 4
Run Program>F:\Program Files\TextPad 4\TextPad.exe
WaitWindowOpen>%WindowName%
SetFocus>%WindowName%
Wait>1

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

//Select All
Press CTRL
Send>A
Release CTRL

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

//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

//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

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

//Run TP 'Remove all 'air'' Macro ALT+Mo
Press ALT
Send>Mo
Release ALT

//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
Wait>0.5


===================================
Best Wishes!
mo
mo
Junior Coder
 
Posts: 49
Joined: Thu Aug 21, 2003 11:02 pm

Postby mo » Mon Sep 01, 2003 11:58 pm

Well I messed with the TextPad settings and it seems that it really doesn't make any difference, but to be on the safe side I set all three of the macros to

macroname,[space]ALT-XX

Now for some reason the above script no longer works if I use both the Delete Blank Lines and the Remove all 'air' macros. The script works, it just does not remove blank lines. The Remove all Air Macro seems to be the badguy here (most likely something to do with my fiddling in TextPad, but I don't know what I did)...and the script does what I need without 'Remove all 'air' (opposite to previous notation).

I'm getting punchy here so if there are any bright ideas, I will consider them...in a bit.
Best Wishes!
mo
mo
Junior Coder
 
Posts: 49
Joined: Thu Aug 21, 2003 11:02 pm

Postby mo » Tue Sep 02, 2003 12:28 am

This is the script to date with the now-relevant comments edited and re-inserted.

I have used it several more times, and without the "Remove all 'air'" macro, it works fine for what I am trying to do. Why that macro doesn't work is still a mystery.

Here is the script:

==========================

//edit4keywords.0.0002.scp
//Script of MO mikeolds@buddhadust.org
//Near 100% revision following suggestions of Robert Hansen
//Monday, September 01, 2003 2:24 PM
//Takes copied text from html formatted pages; pastes to new file;
//moves all copy to the left margin; removes all html tags (using
//TextPad Macro 'Strip Tags'); removes all blank lines(using TextPad
//Macro 'Delete Blank Lines'); saves the file as
//F:\Program Files\MacroScheduler\Macro Scheduler
//Pro\bin\edit4keywords_temp.txt (replacing previous save)
//
//Use Main Menu and keystrokes to activate macros
//Could use ALT-M and up/down arrows, but macro will not always be in //same menu position, so make ALT keys for TP macros:
//In Configure>Preferences>Macros:
//Select the macro, click Properties.
//In Display Name field add "&" (without the quotes)
//before the name to set it as a key for ALT action,
//then place a "," (comma, no quotes) after the name,
//and type in the alt key to be used (e.g. ALT-XX).
//In this script:
//For "Delete Blank Lines" change the name to:
//&Delete Blank Lines, ALT-MD
//For "Strip tags":
//&Strip tags, ALT-MS
//
//NOTE HERE AND ELSEWHERE TP SENSITIVITY TO CASE
//with ALT/CTRL macro commands

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

//Need here:
//How to start the Macro Focused On the Active Document in TextPad,
//?SetFocus>%WindowName%
//?Press CTRL
//?Wait>0.5
//?Send>fn
//?Wait>0.5
//?Release CTRL
//?Wait>0.5
//?Open a New File

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

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

//Select All
Press CTRL
Send>A
Release CTRL

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

//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

//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

//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
Wait>0.5

//Need here:
//1. Exit MacroScheduler (not Textpad File); or,
//2. Pause MacroScheduler to allow editing of file, then continue with
//further routines: Sort list, pause to remove duplicates, run search
//and replace to add commas to the end of each word, run search and
//replace to delete double commas at the end of each word, sort again,
//join all words (CTRL+SHIFT+J), backspace twice to place cursor at
//the end of the line and remove the final comma, select all, copy,
//terminate script, close %FileName%


====================================
Best Wishes!
mo
mo
Junior Coder
 
Posts: 49
Joined: Thu Aug 21, 2003 11:02 pm

Postby mo » Tue Sep 02, 2003 12:50 am

OK, one more glitch: This thing is working for me 2 out of three times, sometimes every other time...the other times it is not deleting blank lines, but is otherwise running without hanging the machine, stopping, etc.

I thougt it might be something to do with CapsOff but inserting it in the usual place or taking it out doesn't seem to make a difference.

This may have been what was happening with the "Remove all 'air'" macro...that is, that it worked a couple of times for me and then stopped working and I thought that was the problem.

I also thought it might have had to do with using the same test copy over and over, sometimes not fully starting from scratch, i.e., just hitting CTRL+C to copy the material. Not this.

This may be a TextPad problem, or it may be my computer...or it may be the script...


EDIT: This is beginning to feel like a computer memory problem: now the thing is not moving the text to the left, is stripping off tags, is not removing blank lines.

I tried rebooting. No change. This is W2KPro with 1G of RAM I'm not supposed to have memory problems (I did a memtest recently!)

THIRD EDIT: Now it's working perfectly again! Likely culpret seems to be the computer. But what happened with this message with no proper line breaks? Not that way in the edit box?
Best Wishes!
mo
mo
Junior Coder
 
Posts: 49
Joined: Thu Aug 21, 2003 11:02 pm

Next

Return to Beginners

Who is online

Users browsing this forum: No registered users and 1 guest