Script for tagging email addresses
Andre Garzia
andre at andregarzia.com
Sat Mar 27 08:43:56 EDT 2010
You should enquote the href string or you will be unable to parse it with a
XML library later, also your code will not be XHTML compliant.
On Sat, Mar 27, 2010 at 2:57 AM, Jim Ault <jimaultwins at yahoo.com> wrote:
> First, I think you have a typo...
>
>
>>
>> E-mail: <a href="Mailto:wonderboy at orcon.net.nz"wonderboy at orcon.net.nz
>> </a>¬
>>
> is missing the closing '>'
>
> E-mail: <a href="Mailto:wonderboy at orcon.net.nz">wonderboy at orcon.net.nz
> </a>¬
>
> secondly, the href string does not have to be enclosed in quotes, so
>
> E-mail: <a href=Mailto:wonderboy at orcon.net.nz>wonderboy at orcon.net.nz</a>¬
> would work.
>
>
> ------- start code --------
> -- assumes a masterList variable set to all lines
> -- 1000 email addresses takes about 6 seconds on an older Mac
>
> put masterList into emailLinesOnly
> filter emailLinesOnly with "*@*"
> set the itemDel to ":"
>
> repeat for each line LNN in emailLinesOnly
> put word 1 to -1 of item 2 of LNN & tab & 0 & cr after newLines
> -- the 0 is a placeholder
> end repeat
> filter newLines without empty
> split newLines using cr and tab
> --dups have now been removed
> --sequence does not matter
> put the keys of newLines into emailAddrList
> filter emailAddrList without empty
> set the itemdel to tab
> repeat for each line LNN in emailAddrList
> replace LNN with ("<a href=" & LNN & ">" & LNN & "</a>") in masterList
> --handles duplicate email addresses in one replace step
> end repeat
>
> put masterList into msg
>
> ------- end code --------
>
> Jim Ault
> Las Vegas
>
>
> On Mar 26, 2010, at 8:40 PM, Sivakatirswami wrote:
>
> anyone have an efficient script for tagging email address with links?
>>
>> let's say I have a chunk of plain text made up of one or more of these:
>>
>> And we want to replace them with links
>>
>>
>> Mr. Wonder Boy
>> 108 Webster Avenue
>> 1004 Mount Zena,
>> NEW ZEALAND
>> E-mail: wonderboy at orcon.net.nz ¬
>>
>> Mr. Wonder Boy
>> 108 Webster Avenue
>> 1004 Mount Zena,
>> NEW ZEALAND
>> E-mail: wonderboy at orcon.net.nz ¬
>>
>> becomes:
>>
>> Mr. Wonder Boy
>> 108 Webster Avenue
>> 1004 Mount Zena,
>> NEW ZEALAND
>> E-mail: <a href="Mailto:wonderboy at orcon.net.nz"wonderboy at orcon.net.nz
>> </a>¬
>>
>> Mr. Wonder Boy
>> 108 Webster Avenue
>> 1004 Mount Zena,
>> NEW ZEALAND
>> E-mail: <a href="Mailto:wonderboy at orcon.net.nz"wonderboy at orcon.net.nz
>> </a>¬
>>
>> I was hoping to avoid replacetext and regEx as it will make it slow.
>>
>> anyone have this already wired up?
>>
>> thanks!
>>
>> Sivakatirswami
>>
>>
>
>
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
--
http://www.andregarzia.com All We Do Is Code.
More information about the use-livecode
mailing list