set theFilesPath to POSIX path of ((path to desktop from user domain as string) & "test.txt")
tell application "Finder"
return modification date of theFilesPath
end tell
All it’s returning is
error “Can’t get modification date of "/Users/user/Desktop/test.txt".” number -1728 from modification date of “/Users/user/Desktop/test.txt”
Why ask the Finder when System Events is able to do the job for Hfs AND for Unix paths ?
set HFSpath to (path to desktop as text) & "cmd unix.pdf"
set UNIXpath to POSIX path of HFSpath
tell application "System Events"
modification date of file HFSpath
--> date "samedi 15 septembre 2012 17:29:26"
modification date of file UNIXpath
--> date "samedi 15 septembre 2012 17:29:26"
end tell
Yvan KOENIG (VALLAURIS, France) mercredi 17 octobre 2012 15:24:05