MACSCRPT Archives

May 2003

MACSCRPT@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:
Bruce Robertson <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Tue, 27 May 2003 10:44:09 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (37 lines)
>> I tried this "manually" in terminal
>> 
>> Man cp >~/mydoc.txt
>> 
>> But the result includes some "stuttering", so I'm wondering about the
>> what
>> would happen if I tried to use this with do shell script.
> 
> Doesn't your teletype machine understand that double characters
> seperated by a ascii 8 are to be bolded?
> This handler will correct the formating. Still a little strange around
> the brackets. Hmmm.
> 
> man("cp")
> 
> on man(theCommand)
>       set t to do shell script "man " & theCommand
>       set the alphabet to
> "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-"
>       set d to ASCII character 8
>       repeat with C in characters of alphabet
>               set AppleScript's text item delimiters to C & d & C
>               set t to text items of t
>               set AppleScript's text item delimiters to (C as text)
>               set t to t as text
>       end repeat
>       set AppleScript's text item delimiters to "•"
>       set t to text items of t
>       set AppleScript's text item delimiters to ""
>       return t as text
> end man

Thanks; but it turns out that there is an existing shell command variation
that can handle this

Man cp | col -b >mydoc.txt

ATOM RSS1 RSS2