今日の日付をクリップボードにコピーするAppleScript
長い間 物事を放置していると、それは忘却の彼方に行ってしまい、いざやろうとしても何の事やらさっぱり訳がわからなくなります。
AppleScript もまた然り。
昔作ったものを見ても、分からない・・・。
ということで、簡単そうなものを作ってみて少しずつでも思い出していこうと「今日の日付をクリップボードにコピーする」スクリプトを作ってみました。
-- クリップボードに今日の日付をコピーする
set theDate to current date
set theYear to year of theDate as text
--set theGengouYear to "平成" & (((year of theDate) - 1988) as text)
set theMonth to month of theDate as integer as text
set theDay to day of theDate as text
--set theWeekday to weekday of theDate as text
set theYoubi to item (weekday of theDate as integer) of {"日", "月", "火", "水", "木", "金", "土"}
set theText to theYear & "年" & theMonth & "月" & theDay & "日" & "(" & theYoubi & ")"
--set theText to theGengouYear & "年" & theMonth & "月" & theDay & "日" & "(" & theYoubi & ")"
set the clipboard to theText
「2018年3月4日(日)」ってな具合に日付をコピーします。
年号表示を和暦(平成)にするなら、年のところをコメント行と入れ替えればできます。あまり試してないので、曜日のところがダメかも?
(参考)
AppleScript : 日付や時刻を利用する - GameSprit