Re: combining open and run handlers
Re: combining open and run handlers
- Subject: Re: combining open and run handlers
- From: Bill White <email@hidden>
- Date: Thu, 01 Apr 2004 19:20:53 -0500
>
Can I combine run and open handlers? In other words can I make a simple
>
application that will do one thing if a file is dropped onto it using an on
>
open handler and also allow a choose file dialog to be produced if the
>
application is double-clicked using an on run handler? Then perform the same
>
task as the droplet after a file has been chosen?
Simplistically:
on run
set theFile to choose file
doWhatever(theFile)
end run
on open theseFiles
set theFile to item 1 of theseFiles -- for a single file
doWhatever(theFile)
end open
on doWhatever(x)
-- work with the dropped or chosen file
end doWhatever
--Bill
_______________________________________________
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.