What value is an empty "File type"?
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