• 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: Paul Berkowitz <email@hidden>
  • Date: Thu, 23 Dec 2004 00:53:18 -0800

Title: Re: Finder - getting file type
On 12/23/04 12:43 AM, "DizzyPenguin" <email@hidden> wrote:

In my application, I *am* using "as Unicode text", but specifying "item" instead of "file", as shown below:

set existFile_wExt to (fullPath & coverName & ".jpg") as Unicode text
tell application "Finder" to set fType to (file type of item existFile_wExt)

This has never caused any problem to any of my customers, except this one who I think may be running a Norwegian OSX system.
I'll try you option(s) and see if this resolve the issue.

So you were making up the 'choose file'. I see.

Well, first make sure that fullPath is Unicode text. If it is, you don't need 'as Unicode text' at the end.

As it happens, not all items have file types (check 'item'). Only files do. all these different ways of referring to the files should work, of course. But Chris Nebel has said a few times that when using the filePath method of addressing files, folder, items etc. (that is "Hard Disk:Folder:File.ext" as opposed to 'file "File.ext" of folder "Folder" of disk "Hard Disk"') it's actually preferable to use 'alias'. So I'd suggest doing that first, I've never ever seen it go wrong with alias:

        set existFile_wExt to (fullPath as Unicode text & coverName & ".jpg")
tell application "Finder" to set fType to (file type of alias existFile_wExt)
   

--
Paul Berkowitz
 _______________________________________________
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: DizzyPenguin <email@hidden>
References: 
 >Re: 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