Re: on run, Expected a reference
Re: on run, Expected a reference
- Subject: Re: on run, Expected a reference
- From: Michelle Steiner <email@hidden>
- Date: Sun, 21 Aug 2005 20:42:59 -0700
On Aug 21, 2005, at 4:36 PM, Andrew Oliver wrote:
In contrast the run handler is calling 'choose folder' which
returns an
alias. You then pass this alias to main() and hence main() fails -
it is
expecting a list and you can't get 'item 1' of an alias
Simplest solution: pass droppedItems as a list:
on run ()
set droppedItems to (choose folder)
main ( {droppedItems} )
end run
Alternatively, use this code:
on run
set droppedItems to choose folder with multiple selections allowed
main(droppedItems)
end run
"with multiple selections allowed" forces droppedItems to be a list,
even if only one item has been selected.
-- Michelle
--
"You don't think he's telling the truth, do you?"
"I wouldn't put anything past him."
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden