Re: String to multiple-item list coercion
Re: String to multiple-item list coercion
- Subject: Re: String to multiple-item list coercion
- From: Paul Skinner <email@hidden>
- Date: Fri, 27 Sep 2002 06:59:55 -0400
set myPath to path to me as Unicode text
set {text: myPath} to (text of myPath) as string
Actually it works in one fell swoop. The oddity is that the 'result'
of this statement is not the actual result. The functional result of
this is that myPath is now <plain text> but the 'result' returned by
the line is actually the 'result' of the '(text of myPath) as string'
statement. Check it out in SD. Strange, but then so is the statement.
Odd how the Unicode thread and the multiple item list thread contorted
and collided in such a non-applescripty statement that can do a simple
coercion to plain text. Where's the 'as plain text'?
To tidy it up so that no one trips over the 'result'...
set unicodeString to the |plain text of |(unicodeString)
--> string <plain text>
on |plain text of |(parameter)
set {text:plainText} to (text of parameter) as text
return plainText
end |plain text of |
On Thursday, September 26, 2002, at 09:14 PM, Paul Berkowitz wrote:
On 9/26/02 1:33 PM, "Paul Skinner" <email@hidden> wrote:
Cool Arthur! That's very close to what I was trying to do with the
Unicode conversion thread that I botched the other day. So close I had
to try using it there...
tell application "Mail"
set unicodeString to the content of the first item of (get the
selection)
end tell
class of unicodeString -->Unicode text
set {text:plainText} to (text of unicodeString) as text
plainText -->plain text!
Yes, that works, in stages:
set myPath to path to me as Unicode text
set {text:plainTextPath} to (text of myPath) as string
--> [international text, i.e. styled]
plainTextPath
--> [plain text]
class of plainTextPath
--> string [plain text]
--
Paul Berkowitz
--
Paul Skinner
It's just text, but you'd think it was quantum theory from all the
dust.
_______________________________________________
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.