Home > AppleScript > [ AppleScript ] 日付を名前にして新規フォルダを作成するサンプル

[ AppleScript ] 日付を名前にして新規フォルダを作成するサンプル

日付を名前にして新規フォルダを作成する AppleScript のサンプルです。 リクエストがあったんで作ってみました。

copy (current date) to today

set Y to year of today
set M to month of today
set D to day of today

if D ≤ 9 then set D to "0" & D

if M is January then set M to "01"
if M is February then set M to "02"
if M is March then set M to "03"
if M is April then set M to "04"
if M is May then set M to "05"
if M is June then set M to "06"
if M is July then set M to "07"
if M is August then set M to "08"
if M is September then set M to "09"
if M is October then set M to "10"
if M is November then set M to "11"
if M is December then set M to "12"

tell application "Finder"
    make new folder at desktop with properties {name:(Y as string) & (M as string) & (D as string)}
end tell

動作確認:Mac OS 10.4.4

Comments:0

コメントフォーム

お気軽にコメントをどうぞ! コメントを頂けると管理人が喜びます。

情報を記憶しますか?

Trackbacks:0

Trackback URL for this entry
http://bowz.info/1205/trackback
Listed below are links to weblogs that reference
[ AppleScript ] 日付を名前にして新規フォルダを作成するサンプル from Bowz::Notebook

Home > AppleScript > [ AppleScript ] 日付を名前にして新規フォルダを作成するサンプル

Feeds
Meta
あわせて読みたいブログパーツ

Return to page top