-- RSS 2.0に打ち込む現在日時をペーストするAppleScriptですが -- 文法がよく分からないままネットで拾ったものを切った貼ったしただけなので -- めちゃくちゃ稚拙です set (selection of document 1) to DateToString(current date) -- date object をパラメタとして渡すと、以下の形式のテキストを返す -- result = "Fri, 05 Mar 2010 18:16:09 +0900" on DateToString(TheDate) set W to Week3Txt(weekday of TheDate) set Y to (year of TheDate) as text set m to Mon3Txt(month of TheDate) set d to Num2Txt(day of TheDate) set H to (time of TheDate) div hours set mi to (time of TheDate) mod hours div minutes set s to (time of TheDate) mod minutes if (count characters of (H as text)) is 1 then set H to "0" & (H as text) --追加 if (count characters of (mi as text)) is 1 then set mi to "0" & (mi as text) if (count characters of (s as text)) is 1 then set s to "0" & (s as text) return W & ", " & d & " " & m & " " & Y & " " & H & ":" & mi & ":" & s & " +0900" end DateToString on Num2Txt(NUM) --数値を2桁に整形したテキストを返す。 return text -2 thru -1 of ("0" & (NUM as text)) end Num2Txt on Week3Txt(CurWeek) if weekday of (current date) is Sunday then set CurWeek to "Sun" else if weekday of (current date) is Monday then set CurWeek to "Mon" else if weekday of (current date) is Tuesday then set CurWeek to "Tue" else if weekday of (current date) is Wednesday then set CurWeek to "Wed" else if weekday of (current date) is Thursday then set CurWeek to "Thu" else if weekday of (current date) is Friday then set CurWeek to "Fri" else if weekday of (current date) is Saturday then set CurWeek to "Sat" end if end if end if end if end if end if end if end Week3Txt on Mon3Txt(CurMonth) if month of (current date) is January then set CurMonth to "Jan" else if month of (current date) is February then set CurMonth to "Feb" else if month of (current date) is March then set CurMonth to "Mar" else if month of (current date) is April then set CurMonth to "Apr" else if month of (current date) is May then set CurMonth to "May" else if month of (current date) is June then set CurMonth to "Jun" else if month of (current date) is July then set CurMonth to "Jul" else if month of (current date) is August then set CurMonth to "Aug" else if month of (current date) is September then set CurMonth to "Sep" else if month of (current date) is October then set CurMonth to "Oct" else if month of (current date) is November then set CurMonth to "Nov" else if month of (current date) is December then set CurMonth to "Dec" end if end if end if end if end if end if end if end if end if end if end if end if end Mon3Txt