Re: Finder - getting file type
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