Re: 'choose from list' question
Re: 'choose from list' question
- Subject: Re: 'choose from list' question
- From: Hanaan Rosenthal <email@hidden>
- Date: Mon, 12 Apr 2004 8:27:04 -0400
- Organization: Custom Flow Solutions
Hi Brennon,
In a perfect AppleScript world, the first script should work as well.
The issue here is that you're taking a list that the Finder created and pass it
directly to the scripting addition command: choose from list.
Try this instead:
tell application "Finder"
choose from list (get name of items of window 1)
end tell
The get command forces the list to be parsed by AppleScript before moving
on to the scripting addition, therefore making it a generic list that the sa can
chew on.
I bet someone else would have a deeper technical explanation as to the
nature of the two lists.
Hanaan
>
>
I'm interested to discover that this fails with error -1700
>
>
tell application "Finder"
>
choose from list (name of items of window 1)
>
end tell
>
>
whereas this works fine
>
>
tell application "Finder"
>
set frontmostWindowItemNames to (name of items of window 1)
>
choose from list frontmostWindowItemNames
>
end tell
>
>
..and so does this
>
>
tell application "Finder"
>
choose from list ((name of items of window 1) as list)
>
end tell
>
>
I understand that an expression like (name of items of window 1) is not
>
really a list, in fact, 'class of' returns {property, property,
>
property...etc.}
>
>
Given that this is not really a list, what is the correct name? I would
>
call it a 'group of elements', but that seems vague.
>
>
If assigning a group of elements to a variable automatically coerces that
>
group of elements to a list - without problem - why doesn't 'choose from
>
list' do the same?
>
>
Should I make an enhancement request on the bugreporter, or is there a
>
good reason for this behavior?
>
>
Brennan
>
_______________________________________________
>
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.
_______________________________________________
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.