• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to test if a dropped item (on open) is a file or folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: How to test if a dropped item (on open) is a file or folder
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Re: Remote Access scripting
  • Next by Date: Intercepting or preventing a menu choice
  • Previous by thread: Re: Portfolio - close a catalog?
  • Next by thread: Re: How to test if a dropped item (on open) is a file or folder
  • Index(es):
    • Date
    • Thread