【AppleScript】ファイルの日付を取得する方法

wakabamac.hatenablog.com

画像一覧の変更日を取得する

set theAlias to choose folder with prompt "フォルダを指定してください"
tell application "Finder"
set theList to (every file of theAlias whose name extension = "jpg")
repeat with f in theList
set theDate to f's modification date -- 変更日
log (theDate) -- (*date 2000年1月1日 土曜日 0:03:00*)
set theYY to year of theDate as text
set theMM to my zeroPrefix(month of theDate as integer)
set theDD to my zeroPrefix(day of theDate as integer)
set theH to my zeroPrefix(hours of theDate as integer)
set theM to my zeroPrefix(minutes of theDate as integer)
set theS to my zeroPrefix(seconds of theDate as integer)
set dateTimeString to theYY & "/" & theMM & "/" & theDD & " " & theH & ":" & theM & ":" & theS
log (dateTimeString) -- (*2000/01/01 00:03:00*)
end repeat
end tell

返信を残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

CAPTCHA