2

我正在尝试显示我选择的文件的扩展名。我究竟做错了什么?

    set theFile to (choose file with prompt "Select a file to transfer:")
    set ext to name extension of theFile
    display dialog ext as text
4

2 回答 2

2

尝试:

tell application "System Events" to set ext to name extension of theFile
于 2012-11-14T02:02:49.620 回答
1

tell application "Finder" set theFile to choose file {} set ext to name extension of theFile display dialog "la extenxion es " & ext end tell

于 2012-11-14T09:24:17.580 回答