Re: Strange Font Pasted in Mail
Re: Strange Font Pasted in Mail
- Subject: Re: Strange Font Pasted in Mail
- From: Yvan KOENIG <email@hidden>
- Date: Mon, 6 Jul 2009 19:36:41 +0200
Le 6 juil. 2009 à 14:26, Christopher Stone a écrit :
On Jul 06, 2009, at 04:21, Christopher Stone wrote:
The weird thing is that the pasted text is Helvetica 12 even
though I have my default message text set to Courier 12, and I
can't seem to find a way around this. Any ideas?
______________________________________________________________________
Hey Folks,
Well. I've tried this every-which-way and can't get it to behave
properly with Applescript, so what I've done is to use QuicKeys'
'Remove Styles' function on the clipboard. This works, and it's
acceptably fast even on my old G4 PowerBook. It is not the
solution I wanted.
If I remember correctly all text on the Mac is now Unicode, and I
wonder if that's not part of the problem. It used to be possible
to force plain text using a raw class. Similar to this:
set s to the clipboard
set s to «class ktxt» of (s as record)
set the clipboard to s
Is there any way to do something similar on Leopard?
Under Leopard, the clipboard's record is often containing:
a «class rtfd» component
a «class RTF » component
a «class utf8» component
a «class ut16» component
a uniform styles component
a string component
a scrap styles component
a Unicode text component
set s to the clipboard as record
set the clipboard to unicode text of s
or
set the clipboard to string of s
or
set the clipboard to «class utf8» of s
or even
set the clipboard to {Unicode text: «class utf8» of s,scrap
styles:«data styl0000»}
leave us with this record:
{Unicode text:bizarre, string:bizarre, scrap styles:«data
styl01000000000010000E00030000000C00000000000000»,«class
utf8»:bizarre, «class ut16»:bizarre]
even if the source font is not Helvetica 12.
The only workaround which I found to drop the default scrap styles is:
set s to the clipboard as record
set srtf to «class RTF » of s
set the clipboard to {class RTF »:srtf}
I can't check its behavior with Mail because Mail is not installed on
my iMac running Leopard (it's not connected to the net)…
Yvan KOENIG (from FRANCE lundi 6 juillet 2009 19:36:36)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden