• 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: Finder - getting file type
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finder - getting file type


  • Subject: Re: Finder - getting file type
  • From: Bill Briggs <email@hidden>
  • Date: Thu, 23 Dec 2004 08:06:14 -0400

Title: Re: Finder - getting file type
At 7:40 AM +0000 12/23/04, DizzyPenguin wrote:
Hi all,

Is there anyone that can tell me why the below first snippet would *randomly* fail (on a OSX 10.3.7 system) while the second one doesn't, while choosing the same file?

 -- start
set x to choose file
tell application "Finder" to set y to file type of x
 --end

 Can't seem to get it to fail, but I'm not going to run it any more. Half a dozen times is enough today. Most of the files on my desktop don't sport a type code, but the script returns the "" as expected. Those that do have a type code (Frame files) return "FASL" as expected.


-- start
set x to choose file
set x to info for x
tell application "Finder" to set y to file type of x
--end

 This one has an unnecessary Finder call. You can simply do this:

set x to choose file  -- OSAX call
set x to info for x  -- OSAX call
set y to file type of x  -- PVA, no Finder necessary

After line two, x will be a record of info, so just ask for the file type from the record. Nothing needed from the Finder.

And given the day,

tell "List"
     if
name is not in {"Grinch", "Bush", "Cheney", "Rummy"} then
           
say "Ho, ho, ho, and a merry Buck$ma$."
end if
end tell

Mercifully we're past the solstice and the days are getting longer again.

- web
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Finder - getting file type
      • From: Emmanuel <email@hidden>
    • Re: Finder - getting file type
      • From: DizzyPenguin <email@hidden>
References: 
 >Finder - getting file type (From: DizzyPenguin <email@hidden>)

  • Prev by Date: Re: Finder - getting file type
  • Next by Date: Re: Finder - getting file type
  • Previous by thread: Re: Finder - getting file type
  • Next by thread: Re: Finder - getting file type
  • Index(es):
    • Date
    • Thread