• 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
Re: Droplet question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Droplet question


  • Subject: Re: Droplet question
  • From: Christopher Nebel <email@hidden>
  • Date: Thu, 28 Feb 2002 11:45:11 -0800

On Thursday, February 28, 2002, at 06:13 AM, Timothy K. Wilkinson wrote:

It was my understanding that when you dropped a file or folder
onto [a] droplet it makes an alias to that folder or file.

If that is they case I'm wondering why if I remover the "on open" handler
and substitute the following code it fails every time because it says the
alias can't understand "count" message.

-- This droplet processes both files or folders of files dropped onto the
applet
--on open these_items
set these_items to choose folder

try
repeat with i from 1 to the count of these_items...

You fell victim to one of the classic blunders. An "on open" handler doesn't get an alias, it gets a list of aliases. "Choose folder", on the other hand, returns a bare alias. Lists know how to "count", but aliases don't, therefore your no-handler script fails. One way to fix the "choose folder" case would be to say "set these_items to {choose folder}" instead -- that way, you get a list containing one alias, just like you would if you had dropped a folder on it.


--Chris Nebel
AppleScript Engineering
_______________________________________________
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.

References: 
 >Droplet question (From: "Timothy K. Wilkinson" <email@hidden>)

  • Prev by Date: Re: Extracting from text [Lecture]
  • Next by Date: Re: Extracting from text [Lecture]
  • Previous by thread: Droplet question
  • Next by thread: Re: Droplet question
  • Index(es):
    • Date
    • Thread