• 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
What value is an empty "File type"?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

What value is an empty "File type"?


  • Subject: What value is an empty "File type"?
  • From: Brett Conlon <email@hidden>
  • Date: Wed, 4 Apr 2007 17:37:46 +1100


A strange question indeed!

I have a bundle script that returns a dialog showing the file type and king of a dropped file on it.

I noticed that there are a number of files with no File Type (as shown in "info for...").

I then tried an if statement to test if the file type is "" then return "not specified"

But the script keeps returning the empty value in the dialog.

I logged the file type variable and it shows as **. I even tried changing the Ftype variable to "as text" but still no good.

It's like there is an invisible value in there...

Any pointers?

Cheers,

Coj

Here's my script:

tell application "Finder"
                set Fname to name of ThisItem
                set Ftype to (file type of (info for (ThisItem))) as text
                log Ftype
                log class of Ftype
                if Ftype is "" then
                        set d1 to "not specified"
                else
                        set d1 to Ftype
                end if
                set Fkind to kind of (info for (ThisItem))
                if Fkind is "" then
                        set d2 to "not specified"
                else
                        set d2 to Fkind
                end if
                tell me to display dialog "File type of file" & return & return & Fname & return & return & "is:" & "   [" & d1 & "]" & return & return & "It may be of kind: " & d2
        end tell
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: What value is an empty "File type"?
      • From: KOENIG Yvan <email@hidden>
  • Prev by Date: Re: EPS to WMF or other vector file format for MS WORD
  • Next by Date: Re: TUAW Script Fails
  • Previous by thread: Re: File Path as URL question
  • Next by thread: Re: What value is an empty "File type"?
  • Index(es):
    • Date
    • Thread