且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

AppleScript的:我是否能够保存使用的文件名和文件路径的变量的文本文件?

更新时间:2023-09-15 20:18:40

Zero的stringForDate处理程序稍微优化版

A slightly optimized version of Zero's stringForDate handler

 on stringForDate(aDate)
     if aDate is "" then set aDate to (the current date)
     if class of aDate is not date then return null
     set {year:dYear, month:dMonth, day:dDay} to aDate
     set dMonth to dMonth as integer
     if dMonth < 10 then set dMonth to "0" & dMonth
     if dDay < 10 then set dDay to "0" & dDay
     return ((dYear & "-" & dMonth & "-" & dDay) as string)
 end stringForDate