I always got the class "«class folder»" for folders.
Now, I'm back under 10.4.11 and get folder.
So, I changed the test to take care of the two encountered results.
set droppedItems to {"Macintosh HD:Users:yvan_koenig:Desktop:for_Merge:", "Macintosh HD:Users:yvan_koenig:Desktop:fakeDB.cwk", "Macintosh HD:Users:yvan_koenig:Desktop:tables_chaînées.numbers:"}
repeat with i from 1 to the count of droppedItems
set currentItem to (item i of droppedItems)
tell application "System Events" to set theClass to (class of disk item (currentItem as text)) as text
if theClass is in {"«class cfol»", "folder"} then
beep
ignoring application responses
say "Folders are not allowed."
end ignoring
display dialog "Folders are not allowed!" buttons {"OK"} giving up after 10
else -- it's a file
log theClass
try
ProcessFile(currentItem, PictureDate, fontSize)
end try
end if
end repeat
and I got the report:
tell application "System Events"
get class of disk item "Macintosh HD:Users:yvan_koenig:Desktop:for_Merge:"
folder
end tell
tell current application
beep
say "Folders are not allowed."
display dialog "Folders are not allowed!" buttons {"OK"} giving up after 10
{button returned:"OK", gave up:false}
end tell
tell application "System Events"
get class of disk item "Macintosh HD:Users:yvan_koenig:Desktop:fakeDB.cwk"
file
(*file*)
get class of disk item "Macintosh HD:Users:yvan_koenig:Desktop:tables_chaînées.numbers:"
file package
(*file package*)
end tell
Yvan KOENIG (VALLAURIS, France) vendredi 9 octobre 2009 19:10:28