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: Fri, 29 Nov 2002 02:45:28 +0000
on Thu, 28 Nov 2002 07:52:06 -0600, ehsan saffari <email@hidden>
wrote:
>
------------------
>
("<<" is option-\ and ">>" is option-Shift-\)
>
------------------
>
tell application "FileMaker Pro 4.0v3"
>
set p to cell "Text" as styled text
>
end tell
>
>
try
>
set pp to (p as record)'s <<class ksty>> as string
>
on error m
>
set m to m's text 12 thru -16
>
end try
>
>
if m = "<<data styl>>" then
>
display dialog "Plain Text"
>
else
>
display dialog "Styled Text"
>
end if
>
-----------------
Neat use of the error message, ehsan!
If you're interested, here's a variation[1] which might work[2] a bit
faster[3]:
=================
on isPlainText(v)
({{p:v}} as string)'s text -8 thru -5 = "styl"
end isPlainText
=================
Kai
-----------------
[1] Borrowing from Arthur's hack
[2] Again, for FMP only
[3] OMM, about 3-5 times quicker
--
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.