NISUS Archives

March 2010

NISUS@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Reply To:
Date:
Sat, 20 Mar 2010 12:14:36 +0900
Content-Type:
text/plain
Parts/Attachments:
text/plain (35 lines)
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

ATOM RSS1 RSS2