how to: copy selected links into another window

Help with writing and playing macros

how to: copy selected links into another window

Postby paonza » Tue Oct 03, 2006 8:38 am

Hi All!
I have an "how to" issue:

i have an sql file and i need to extract all the image link as http://www.domain.com/path/path/path/image.jpg

I used the find command with regular expression like:
find http://www.domain.com*.jpg

I can highlight all the items found but... how to copy all items into another windows in one click??
thank you!
Fabio
User avatar
paonza
Newbie
 
Posts: 2
Joined: Mon Oct 02, 2006 11:00 pm

Re: how to: copy selected links into another window

Postby Mofi » Tue Oct 03, 2006 12:24 pm

I guess, you will only have the links and not the rest of the lines. So you need a macro for this job. The macro property Continue if a Find with Replace not found must be checked for this macro. Here is the code:

InsertMode
ColumnModeOff
HexOff
UnixReOff
Clipboard 9
ClearClipboard
Top
Loop
Find RegExp "http://www.domain.com*.jpg"
IfNotFound
ExitLoop
EndIf
CopyAppend
EndSelect
Key LEFT ARROW
Key RIGHT ARROW
EndLoop
NewFile
UnicodeToASCII
UnixMacToDos
Paste
Top
Find "http:"
Replace All "^phttp:"
Bottom
IfColNum 1
"Sorry, no image link found!"
Else
"
"
Top
DeleteLine
EndIf
ClearClipboard
Clipboard 0
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4058
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: how to: copy selected links into another window

Postby paonza » Tue Oct 03, 2006 1:02 pm

Hi Mofi!

CopyAppend! this is the solution!

Thank you!
Fabio
User avatar
paonza
Newbie
 
Posts: 2
Joined: Mon Oct 02, 2006 11:00 pm


Return to Macros