我正在尝试显示我选择的文件的扩展名。我做错了什么?
set theFile to (choose file with prompt "Select a file to transfer:")
set ext to name extension of theFile
display dialog ext as text
答案 0 :(得分:2)
尝试:
tell application "System Events" to set ext to name extension of theFile
答案 1 :(得分:1)
告诉应用程序“Finder” 设置文件选择文件{} 将ext设置为theFile的扩展名 显示对话框“la extenxion es”& EXT 结束告诉