#This AppleScript is for get latest log file generated during automatic build server.
set sourceFolder to "Users:....:.....:targetFolder"
property the_path : "/Users/..../.../targetFolder"
set theFolder to (POSIX file the_path) as alias
tell application "Finder"
set itemGroup to sort (get every folder of theFolder) by creation date
set LatestFolder to (get first item of itemGroup)
set LatestFolderName to LatestFolder's name
end tell
set latestFilePath to "/Users/..../..../targetFolder/" &
LatestFolderName & "/log"
#This AppleScript is for get latest folder and it's name.
set sourceFolder to "Users:....:.....:targetFolder"
property the_path : "/Users/..../.../targetFolder"
set theFolder to (POSIX file the_path) as alias
tell application "Finder"
set itemGroup to sort (get every folder of theFolder) by creation date
set LatestFolder to (get first item of itemGroup)
set LatestFolderName to LatestFolder's name
end tell