Re: Fun with coercing to string
Re: Fun with coercing to string
- Subject: Re: Fun with coercing to string
- From: "Stephen Swift (aka Burnum)" <email@hidden>
- Date: Wed, 21 Feb 2001 10:44:17 -0500
At 2/21/01 2:09 AM, Richard 23 (email@hidden) Wrote:
>
Display dialog and indeed choose from list both are auto-coerce-to-string
>
challenged. What you are seeing is the month's 4-character type code.
>
>
Unfortunately the coercion you are expecting ("WHAT DOESN'T WORK" does,
>
just not until Mac OS 8.6) didn't arrive until AppleScript 1.3.6:
That's too bad. It seems everywhere I turn I run into - Oh, 8.1 didn't have
that feature.
<Note to Self> UPGRADE!!! </note>
>
>
Yet in 9.0.4 I don't seem to be able to coerce the current date value to
>
a list of properties like the reference you quote. Odd.
>
>
> According to my AppleScript reference tables current date command is
>
> coercible to a list of its properties.
>
>
You may have misread this. I see coercible to a single-item list which
>
is kind of a cheat. Anything can be made into a single-item list by
>
wrapping braces around it. Who decided to call that a coercion?
Yeah I did misunderstand that.
(current date) as list --> {date "Wednesday, February 21, 2001 10:37:06 AM"}
Which doesn't get me anywhere.
And {weekday of (current date), month of (current date), day of (current
date), year of (current date), time of (current date), time string of
(current date)} isn't coercion in my books. That's just making a list.
>
>
For real fun though you should try my CoerceToString handler.
>
I would appreciate it if you would contact me offlist to let me know
>
if you have success with it. I have used various incarnations of the
>
method but didn't codify and version it until recently.
I tried it and -well let me first state that I'm a novice in AppleScript.
Okay let me restate that. I'm less than a novice.- encountered some
questions.
property Original_CTS : ask
--ask? Do I need to put something there, or is this okay?
On running the script, AppleScript gave me this error:
The variable anything is not defined.
I'm guessing it doesn't like this line:
if theValue's class = anything then set defaultRec to theValue & defaultRec
I'm not sure if I was clear enough with the problems I encountered. If you
can help great, but if you need more information I'll try to give you some
more. Thanks.
Stephen Swift ?' (The Burnum Man)
email@hidden
It9s Coming Back! AppleInfo.net - Check Back Soon
-----------------------------------------------
"He was the only person I met who knew more about electronics than me." -An
exaggeration by Steve Jobs, explaining his initial fascination with Woz