• 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: Tim <email@hidden>
  • Date: Mon, 28 Jan 2002 15:38:29 -0500

At 8:46 AM -0800, on 1/28/2002, you 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

This test works, thanks to Arthur Knapp's use of (as alias as string)

on open thisCD
set thePath to thisCD as text
if (thePath as alias as string) ends with ":" then
display dialog thisCD as text buttons "OK"
else
set myName to thisCD
display dialog "yubba" buttons "OK"
end if
end open

Now, if you can squeeze that into a larger script that grabs the file info, but branches into a subfolder when the above test is true to grab all the file info from THAT folder... :-)

Tim
--


--------------------------------------------------------------
http://www.belimah.com
http://www.filemakerdev.com

"Here's the mirror, behind there is a screen
Turn around
On both ways you can get in"
--------------------------------------------------------------


  • Follow-Ups:
    • Re: OS X test for Class Folder...continues
      • From: Rich Fortnum <email@hidden>
  • Prev by Date: Re: Speed of applets vs. compiled scripts
  • Next by Date: Re: OS X test for Class Folder...continues
  • Previous by thread: Re: Scripting Additions: Embracing the Horror of Unix
  • Next by thread: Re: OS X test for Class Folder...continues
  • Index(es):
    • Date
    • Thread