Re: Template for Debugging "on Open..." Handler
Re: Template for Debugging "on Open..." Handler
- Subject: Re: Template for Debugging "on Open..." Handler
- From: Michael Terry <email@hidden>
- Date: Fri, 19 Mar 2004 22:56:16 -0800
On Mar 19, 2004, at 5:57 PM, steve harley wrote:
set fileList to choose file with multiple selections allowed
if class of fileList is not list then set fileList to fileList as
list -- in case of single selection
my experience is that "with multiple selections allowed" guarantees
that the result is a list
As far as I know, the result of 'choose from list' is always a list
except when it's not. But it's only not when the user picks the cancel
button, in which case it's false. In any case, because coercing a list
to a list doesn't do anything, that allows a more elegant method for
guaranteeing a list:
repeat with i in ((choose from list {1, 2, 3}) as list)
if i's contents is false then error "User canceled." number -128
-- do some stuff with list items
end repeat
Mike
_______________________________________________
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.