• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Retrieving Rich Text from a file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Retrieving Rich Text from a file


  • Subject: Retrieving Rich Text from a file
  • From: Michael Superczynski <email@hidden>
  • Date: Sat, 26 Jul 2003 08:10:41 -0400

I have a rich text file that I would like to read from and move the
data to a variable for subsequent transfer to a text field in a window.
I want to move the text "This is line 1.", "This is line 2.", etc.
with the formatting retained.

Any insights are appreciated.

tell current application
open for access alias "Macintosh HD:Users:mike:Desktop:text.rtf"
without write permission
1079
get eof alias "Macintosh HD:Users:mike:Desktop:text.rtf"
381.0
read 1079
"{\\rtf1\\mac\\ansicpg10000\\cocoartf102
{\\fonttbl\\f0\\fnil\\fcharset77 LucidaSans-Typewriter;}
{\\colortbl;\\red255\\green255\\blue255;}
\\margl1440\\margr1440\\vieww10860\\viewh7000\\viewkind0
\\pard\\tx720\\tx1440\\tx2160\\tx2880\\tx3600\\tx4320\\tx5040\\tx5760\\t
x6480\\tx7200\\tx7920\\tx8640\\ql\\qnatural

\\f0\\fs24 \\cf0 This is line 1.\\
This is line 2.\\
This is line 3.\\
This is line 4.\\
This is line 5.\\
}"
close 1079
end tell
_______________________________________________
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.

  • Prev by Date: RE : Every running application
  • Next by Date: Re: UI Scripting FileMaker
  • Previous by thread: RE : Every running application
  • Next by thread: Re: Retrieving Rich Text from a file
  • Index(es):
    • Date
    • Thread