Re: Finder - getting file type
Re: Finder - getting file type
- Subject: Re: Finder - getting file type
- From: DizzyPenguin <email@hidden>
- Date: Thu, 23 Dec 2004 09:02:40 +0000
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, yes and no. I did send the user the code snippets to try out and the first one failed, but not the second one.
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)
Isn't it safer to have the "
as Unicode text" at the end, in case the
coverName variable contains accented characters (here I go again with those!)?
Regards,
Guy
--
DizzyPenguin * autoMAC-it
email : <email@hidden>
website : <http://www.dizzypenguin.com/automac-it/>
_______________________________________________
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