Re: How to test if a dropped item (on open) is a file or folder
Re: How to test if a dropped item (on open) is a file or folder
- Subject: Re: How to test if a dropped item (on open) is a file or folder
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 03 Jul 2002 13:23:04 -0700
On 7/3/02 1:14 PM, "Spunk S. Spunk III" <email@hidden> wrote:
>
This works just fine for me (on X too)...
>
>
on open (filesOrFolders)
>
set itemOne to item 1 of filesOrFolders
>
if folder of (info for itemOne ) then
>
display dialog "You dropped a folder on me!"
>
else
>
display dialog "you dropped a file on me!"
>
end if
>
end open
But it will tell you that a cocoa app is a folder (try Chess). If that's
what you want, good. If not, check for 'package folder' of info for as well,
as in my last message. It's best then just to get 'info for' once, and set a
variable to it so the record is available for both checks without having to
call the addition again. That's why I wrote it that way in the last message
(which you probably hadn't got yet when you sent this one).
--
Paul Berkowitz
_______________________________________________
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.