Re: String to multiple-item list coercion
Re: String to multiple-item list coercion
- Subject: Re: String to multiple-item list coercion
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 26 Sep 2002 18:09:09 -0700
On 9/26/02 11:41 AM, "Arthur J. Knapp" <email@hidden> wrote:
>
> Date: Thu, 26 Sep 2002 13:12:32 +0100
>
> Subject: Re: String to multiple-item list coercion
>
>
>>> set {day:a, month:b, year:c} to date "Sunday, September 1, 2002 12:00:00am"
>
>>> return {a, b, c}
>
>>> --> {1, September, 2002}
>
>
Testing various aspects of the above made me realize that one can do
>
without the << >> characters in the styled text to plain text conversion:
>
>
set styled_text to the clipboard -- assuming styled text on clipboard
>
>
set {text:plain_text} to styled_text
>
>
plain_text --> yup, plain text
>
>
Actually, this is far nicer than the "<<class ktxt>> ... as record" thing
>
because it doesn't error on plain text:
>
>
set { text : x } to styled_text -- x == plain text
>
set { text : y } to plain_text -- y == plain text
>
But not, for some reason, for the
Unicode-text-that-is-not-REAL-Unicode-but-is styled-text:
In OS 10.2.1:
set myPath to path to me as Unicode text
set {text:plainTextPath} to myPath
plainTextPath
class of plainTextPath
--> Unicode text
set myPath to path to me as Unicode text
set {<<class ktxt>:plainTextPath} to myPath as record
plainTextPath
class of plainTextPath
--> string
--
Paul Berkowitz
_______________________________________________
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.