Something VERY wrong with Macro Function!

General questions about using TextPad

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

Post Reply
1ND1G0
Posts: 7
Joined: Fri Dec 05, 2008 6:41 am

Something VERY wrong with Macro Function!

Post by 1ND1G0 »

Using Version 7.09 (32 bit) of TextPad, I created a Macro to Search for the Video URLs in a YouTube Channel page.
I copied the Source HTML and pasted it into TextPad and then did the following:


Ctrl-Home

Find:
^\s+href="(/watch\?v=.+)"

Mark all (Bookmark line)
Search > Bookmark > Inverse Bookmark
Search > Bookmark > Remove Bookmarked Lines

Find:
^\s+href="(/watch\?v=.+)"

Replace:
http://www.youtube.com$1


As I created the Macro I was left with a page containing 30 Video URLs.

But when I ran the Macro on the same Source I only got 29 Video URLs.
The last URL was Missing!

So I thought perhaps if I added an extra line at the end, half-way thru the Macro, I might get the Correct Result!
Sadly the Macro Ended Prematurely and failed to complete the Final Stage.

I tried endless variations but still no joy!

In the end I had to settle for the following:



Ctrl-Home

Find:
^\s+href="(/watch\?v=.+)"

Replace:
http://www.youtube.com$1

Find:
^[^h].+$

Replace:

Find:
^[^h]?$

Replace:

Find:
^\s*\n

Replace:



This works fine on Version 7.09 (32 bit) of TextPad

I tried using the first Macro on Version 6 of TextPad and it still omitted the last URL.

So then I tried it on Version 7.10 (64 bit and 32 bit) and it still omits the last URL.

But when I tried the working version of the Macro (Version 2 above), Version 7.1.0 (64 bit and 32 bit) just hung!


Finally found a Solution that works on TextPad 7.1.0 without hanging:



Ctrl-Home

Find:
^\s+href="(/watch\?v=.+)"

Replace:
http://www.youtube.com$1

Find:
(^[^h].+$)|>|(^\s*\n)

Replace:



The thing that causes 7.1.0 to hang is replacing what could be a "null string" with a "null string" eg:


Find:
^[^h]?$

Replace:



It works OK if the Replacement Expression is not a "null string"
and it worked OK previous to 7.1.0 even if it were a "null string"

So It looks like we have 2 bugs still to be fixed.

Also why is 'Undo' still missing from the 'Edit' Menu?
Post Reply