Re: Detecting if text is styled
Re: Detecting if text is styled
- Subject: Re: Detecting if text is styled
- From: Kai Edwards <email@hidden>
- Date: Mon, 02 Dec 2002 00:32:19 +0000
on Fri, 29 Nov 2002 08:12:10 -0600, ehsan saffari <email@hidden>
wrote:
>
On 29/11/2002 00:00, Kai Edwards <email@hidden> wrote:
>
> =================
>
>
>
> on isPlainText(v)
>
> ({{p:v}} as string)'s text -8 thru -5 = "styl"
>
> end isPlainText
>
>
>
> =================
>
>
It is certainly better than my approach since it doesn't choke on large
>
styled text chunks
>
>
if m = "<<data styl>>" then
>
--> Can't perform operation on text longer than 32K bytes. (-2721)
FWIW, the above 'isPlainText' subroutine also appears to work for 'the
clipboard' from Jon's Commands - but not for the version from Standard
Additions.
For a single subroutine to handle either, something like this might do:
=================
on isPlainText(v)
set {tid, text item delimiters} to {text item delimiters, "styl"}
set d to ({{p:v}} as string)'s text item -1
set text item delimiters to tid
tell d's length to it = 4 or it = 32026
end isPlainText
=================
Kai
--
email@hidden
email@hidden
_______________________________________________
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.