且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何以编程方式使用applescript获取最新下载的文件名?

更新时间:2023-02-12 19:27:33

这将为您提供下载文件夹的最新文件(按创建日期排序):

This will give you the latest file (sorted by creation date) of your downloads folder:

tell application "Finder"
    set latestFile to item 1 of (sort (get files of (path to downloads folder)) by creation date) as alias
    set fileName to latestFile's name
end tell