Re: Read RTF in OS X?
Re: Read RTF in OS X?
- Subject: Re: Read RTF in OS X?
- From: Jason Bourque <email@hidden>
- Date: Mon, 22 Apr 2002 09:11:20 -0400
Mr Tea,
Thanks, that makes sense.
Thanks,
Jason Bourque
Co-Director Boston AppleScript Users Group
On 4/22/02 7:52 AM, "Mr Tea" <email@hidden> wrote:
>
set theRTF to [a suitable item]
>
tell application "TextEdit"
>
open theRTF
>
set theText to every paragraph of text of document 1 as text
>
end tell
>
>
One thing that I've found when doing this is that if I send the contents of
>
the variable to the clipboard for pasting into a document elsewhere, the
>
pasted text contains the 'wrong kind' of return characters. I knocked up the
>
following routine to fix that:
>
>
set ASTIDs to AppleScript's text item delimiters
>
set AppleScript's text item delimiters to ASCII character 10
>
set someParas to every text item of theText
>
set theParaStore to {}
>
repeat with thePara in someParas
>
set the end of theParaStore to (thePara & return)
>
end repeat
>
set AppleScript's text item delimiters to ASTIDs
>
set the clipboard to theParaStore as text
>
>
>
Mr Tea
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.