On Mar 20, 2010, at 9:36 AM, Þorvarður Davíðsson wrote:
> Let’s assume I have a text like this:
>
> bla, bla, Text1, bla, Text2, bla, bla, Text3
>
> I command-select Text1, Text2 and Text3 (non-contiguous selection), run a macro and would now be able to paste a vertical list like this:
>
> Text1
> Text2
> Text3
$sep = Cast to String "\n"
$doc = Document.active
if $doc == undefined
exit
end
$str = $doc.selectedSubtexts
$str = $str.join $sep
if $str == ''
exit
end
# $str &= $sep # uncomment this command if you need $sep at the end too
Write Clipboard $str
> I also need another macro that enables me to paste a *horizontal* line like this:
>
> Text1, Text2, Text3
Replace "\n" of the first line of the macro with ', '.
Kino
|