What's the easiest way of determining the suffix of a file?


I’ve seen, somewhere on these pages, a way of getting the file suffix, that was as easy as something like

set thesuffix to suffix of theFile.

but I can’t find it anywhere.

Any help please.



Model: G5 1.8 GHz
AppleScript: 2.1.1
Browser: Safari 419.3
Operating System: Mac OS X (10.4)


set the_file to choose file
set suffix to name extension of (info for the_file)
display dialog name extension of (info for (choose file))

That was QUICK, thanks James & Stefan

Thank stefan, his rocket like responses prompt me to try and move ever faster :stuck_out_tongue: