How to test if a dropped item (on open) is a file or folder
How to test if a dropped item (on open) is a file or folder
- Subject: How to test if a dropped item (on open) is a file or folder
- From: "Spunk S. Spunk III" <email@hidden>
- Date: Wed, 03 Jul 2002 08:11:31 -0700
Hi all,
I can't quite figure out the syntax for testing whether a dropped item is a
file or a folder. Everything I've tried gets an errors "can't get {kind or
type or class, etc} of [alias] Path:to:my:fileOrFolder". I've tried
referencing the alias (returned from the dropped item) directly as well as
"as string" but nothing seems to work. Eg.
on open (filesOrFolders)
set numOfItems to (count of filesOrFolders)
-- handle only one file/folder being dropped
if numOfItems is equal to 1 then
set item1 to filesOrFolders as string -- optional line
-- if (kind of filesOrFolders ) is "folder" then -- tried this too
if (kind of item1) is "folder" then
display dialog "You dropped a folder!"
...
end if
end open
I've tried a million other variations as well. I need to know if the dropped
items are files or folders...
Thanks,
Spunk
_______________________________________________
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.