Re: Script to Copy/Paste Entourage Message Bodies
Re: Script to Copy/Paste Entourage Message Bodies
- Subject: Re: Script to Copy/Paste Entourage Message Bodies
- From: Ramona Rock <email@hidden>
- Date: Tue, 25 Mar 2003 18:53:59 -0800
Thank you for explaining everything Paul, it's nice to understand more why
things work . . . Or don't work. :)
This is getting long so I'm going to just put my responses at the top here.
The short response is I just didn't know yet I was asking a stupid question.
:) The longer response is, with regard to the rich text thing, I haven't
used TextEdit that much yet since I have Word, but wanted to use it for this
since I understood it to be more easily scripted. Thus, I didn't really
understand "rich text." I had been previously accomplishing what I needed
the script to accomplish by manually copying and pasting Entourage message
bodies into a TextEdit doc. Obviously, THAT got really tedious really fast,
hence the need for the script. However, when I was doing the tedious thing
the resulting document was much easier to read, and seemed to want to save
itself as "rich text" or rtf. I let it do that, and thought the better
legibility was due to that format. The script you wrote sends the stuff in
Monoco, in a very small font, next to impossible to read. But I'm now
realizing what I can and should do is just change the font and the size to
something my eyeballs can handle post running of script, leaving it a plain
text doc with the .txt extension, so my other apps will recognize it.
Thinking I needed "rich text" was just a misunderstanding of the format on
my part. Sorry! And thanks again for your help!
Ramona.
on 3/25/03 2:47 PM, email@hidden at email@hidden wrote:
>
On 3/25/03 1:30 PM, "Ramona Rock" <email@hidden> wrote:
>
>
> Yay! That's brilliant, and it works! Thank you! I do have a couple of
>
> minor questions if you don't mind, but that's definitely the substance of
>
> the thing. Since you said there were problems with option #2, I just went
>
> with option #1.
>
>
>
> 1. Why does it send it as plain text instead of rich text? This is a very
>
> minor thing since I know I can just change it back to rich text after it
>
> gets there, but I had to ask.
>
>
First of all, 'content' property of message in Entourage is always a string.
>
[1] A plain text string. So even if you have HTML formatted text in
>
Entourage it will just transfer as plain text content anyway. You can't get
>
the formatted text. [2] Since it's plain text, we might as well make a text
>
file. AppleScript (since the middle ages and then again since AS 1.7 or 1.8,
>
but not in 1.6) automatically assigns "TEXT" file type to any file you make
>
with 'open for access'. This actually is plain text (.txt, "TEXT") not RTF.
>
Since it has this automatically given file type, and doesn't have an
>
extension, the icon displays the "TEXT" type. Why do you want to make it RTF
>
when it isn't rich text, may I ask? If you add ".rtf" to fileSpec you make a
>
nice looking RTF icon for the file, but TextEdit can't open it because it's
>
not been encoded as RTF. Try it - it won't open, not even double-clicking it
>
in the Finder. It's text, not RTF. (You could add ".txt" to the "newstuff"
>
name. Otherwise, if you play around too much with the same file, it will
>
lose its text icon.)
>
>
>
> 2. The TextEdit document gets opened, accessed and receives the data as
>
> expected. But if I make any changes to the document after that (I was just
>
> making it rich text and a little bigger like it was originally in Entourage
>
> so I could read it better, the text originally gets to the document smaller
>
> and in plain text) it changes the name of the document to Untitled? What's
>
> up with that?
>
>
No, that's because you changed its format to RTF. TextEdit will never save
>
the back into the same file when you change the format, even if there's no
>
".txt" extension. it knows the original was not RTF, so it wants you to save
>
it as a new file, since it will be assigning the .rtf extension when you
>
close it. Try closing the file - you'll see. It wants you to re-save it with
>
a new name. To avoid all this, just leave it as TEXT. Assign it the .txt
>
extension in the script to make TextEdit happy.
>
>
>
>
>
[1]. Actually it's Unicode in Entourage itself, but is coerced automatically
>
to string in Entourage's AppleScript because AppleScript did not have proper
>
Unicode back when Entourage X came out. You can get the Unicode version by
>
adding 'as Unicode text' but that won't get you rich text, it just gets you
>
foreign characters, to cut a long story short. Chances are that in a later
>
version of Entourage the automatic coercion to string will not occur.
>
Therefore I added 'as string' because if you write Unicode to a text file
>
you need to preface it with some characters to indicate to TextEdit that
>
this is Unicode or it leaves empty space between every character when it
>
displays the file. I didn't want to get into all this.
>
>
[2] If it's HTML, you could get all the HTML source code by parsing the
>
message's source property, but you'd need some other application like a web
>
browser that could handle HTML code to display it.
_______________________________________________
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.