【问题标题】:Applescript Choose file, filenameApplescript 选择文件,文件名
【发布时间】:2015-10-17 08:10:02
【问题描述】:

我想做的是这样的:

set filename to (choose file)
display dialog "The name of the chosen file is: " & filename

但是当我使用该脚本时,它会返回一个文件路径,例如 .../.../.../.../nameofile.jar。但我想要的是它会返回文件名而不是路径(所以只有 nameofile.jar)。有没有办法做到这一点?

感谢阅读,请尽快给予答复;),

乔特

【问题讨论】:

    标签: macos applescript filenames osx-yosemite


    【解决方案1】:

    使用 Finder 套件:

    set chosenfile to (choose file)
    
    tell application "Finder"
        display dialog "The name of the chosen file is: " & (name of chosenfile)
    end tell
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-12-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-11
      相关资源
      最近更新 更多