Re: Selecting every item of one disk's desktop
Re: Selecting every item of one disk's desktop
- Subject: Re: Selecting every item of one disk's desktop
- From: Richard 23 <email@hidden>
- Date: Fri, 2 Mar 2001 02:04:10 -0800
R23 posted:
>
> -- ------------------------------------------
>
> -- workaround for single-item alias list bug
>
> -- ------------------------------------------
>
> on AsAliasList(theRef)
>
> try
>
> theRef as <<class alst>>
>
> on error
>
> theRef as alias as list
>
> end try
>
> return result
>
> end AsAliasList
>
> -- ---------------------------------------------------------
>
>
>
> Let me know if you have any questions.
>
>
Ric Phillips queried:
>
I have one. What is a 'single-item list bug'?
>
I haven't heard of this one.
>
I have one. What is a 'single-item list bug'?
>
I haven't heard of this one.
Michelle offerred:
>
Sometimes, when only one item is returned, it's returned as an item
>
instead of a single-item list.
>
>
e.g, two items
>
>
{item1, item2}
>
>
single item
>
>
item1 instead of {item1}
R23 clarified:
That's not quite what I was referrring to...I think.
Something easy to test is the Finder's selection.
Select 2 or more items in the Finder or even 0 items then run this:
tell application "Finder" to get selection as alias list
then select a single item and try again
--> Can't make alias "..." into a +class alst;.
The single item vs list thing is even easier:
if you always want a list, even for a single item use "as list"
if you want a single item rather than a single item list use "as item"
{{1} as item, {1,2} as item, 3 as item}
--> {1, {1, 2}, 3}
{1 as list, {1} as list}
--> {{1}, {1}}
{{{{{4}}}}} as item
--> 4
R23