• 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
Re: Detecting if text is styled
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: alert windows
  • Next by Date: Finding a volume name
  • Previous by thread: alert windows
  • Next by thread: Finding a volume name
  • Index(es):
    • Date
    • Thread