• 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: OS X test for Class Folder...continues
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OS X test for Class Folder...continues


  • Subject: Re: OS X test for Class Folder...continues
  • From: Paul Berkowitz <email@hidden>
  • Date: Mon, 28 Jan 2002 10:02:16 -0800

On 1/28/02 8:19 AM, "Rich Fortnum" <email@hidden> wrote:

> christian vick chortled:
>
>> If you coerce the path reference to a string, you can test for an folder by
>> asking for the colon at the end:
>>
>> Set ThePath to (alias foo as string)
>> If ThePath ends with ":" then display dialog "this is a folder!" buttons
>> "OK"
>
> Actually, won't work. Can't coerce this into a string, either as a direct
> reference, or as a drop application.
>
>> on open thisCD
>> set ThePath to thisCD as string
>> if ThePath ends with ":" then
>> display dialog thisCD buttons "OK"
>> else
>> set myName to thisCD
>> display dialog "yubba" buttons "OK"
>> end if
>> end open
>
> Can't get that into a string to test to see if it's a folder
>
>
That's because 'on open' takes a list of aliases, not a single item. First
you have to do a repeat loop for each item or, if you know you will be
dropping only one item at a time, just get 'item 1'. I.e

on open theItems
set theItem to (item 1 of theItems) as string

--
Paul Berkowitz


  • Follow-Ups:
    • Re: OS X test for Class Folder...continues
      • From: Mr Tea <email@hidden>
References: 
 >Re: OS X test for Class Folder...continues (From: Rich Fortnum <email@hidden>)

  • Prev by Date: Re: Can any tell me about error -1701?
  • Next by Date: Re: Speed of applets vs. compiled scripts
  • Previous by thread: Re: OS X test for Class Folder...continues
  • Next by thread: Re: OS X test for Class Folder...continues
  • Index(es):
    • Date
    • Thread