Subject: Re: text appears, but styling is gone
Subject: Re: text appears, but styling is gone
- Subject: Subject: Re: text appears, but styling is gone
- From: Philippe GRUCHET <email@hidden>
- Date: Mon, 13 Jan 2003 02:03:45 +0100
From: has <email@hidden>
BTW, is it just me, or do Safari, TextEdit, etc. lose style
information when you get the text of a document?
tell application "Safari" to get text of document 1
tell application "TextEdit" to set text of document 1 to result
--> text appears, but styling is gone
Yes, styles are ignored, even with Jon's Commands.osax:
tell app "Safari" to text of document 1 as styled text
just returns as plain text.
But not unstyled text: what comes back is styled Unicode text, but the
style is plain (and always the same). Which doesn't make sense to me.
If it's by design, I'd like to know why; if not, I'd assume it's a bug
of some sort.
Unicode is not a style but the universal alphabetic code.
Here, any text returned is always displayed with the default font
Geneva and default size 12.
I don't think it's a bug, but the simple fact that styles are not
directly handled by these applications via a standard (implicit or
explicit) coercion.
So, those coercions always return an error:
tell app "Safari" to text of document 1 as every styled text
tell application "Safari" to text of document 1 as styled Unicode text
tell application "Safari" to text of document 1 as styled text -->
NSReceiverEvaluationScriptError: 4
And:
tell application "Safari" to text of document 1 as Unicode text
is same as:
tell application "Safari" to text of document 1 as text
is same as:
tell application "Safari" to text of document 1
=> no style.
Kind regards,
Philippe Gruchet/SVM Mac
VNU Publications France
http://svmmac.vnunet.fr
_______________________________________________
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.