我试图在AppleScript中获取文件的最后修改日期。我以为我已经使用这个工作:在AppleScript中获取文件的最后修改日期
set thePath to (((path to documents folder) as text) & "speed.txt")
set modDate to modification date of file thePath
,这似乎返回一个有效的值,但是当我把这个一个on idle
片的代码里面我得到一个:
“不能得到的......”错误
类<>我看到别的地方建议使用:
set the modDate to (do shell script "mdls -name kMDItemLasUsedDate " & quoted form of the POSIX path of thePath)
但这返回null
。关于如何获得修改日期的任何想法?
它必须AppleScript的?你可以很容易地使用stat filename – michael501
FYI来做到这一点:对于你的shell脚本命令,有一个可以工作的“kMDItemContentModificationDate”。 – regulus6633