AppleScript名:指定日時以降に作成されたファイルをSpotlight検索 v3 |
— Created 2017-09-21 by Takaaki Naganoya — Modified 2017-09-22 by Shane Stanley — 2017 Piyomaru Software use AppleScript version "2.5" use scripting additions use framework "Foundation" use mdLib : script "Metadata Lib" version "1.0.0" –http://piyocast.com/as/archives/4841 property NSTimeZone : a reference to current application’s NSTimeZone property NSCalendar : a reference to current application’s NSCalendar set aDate to getDateInternationalYMDhms(2017, 10, 22, 0, 0, 0) of me –> (NSDate) 2017-09-21 14:02:00 +0000 set thePath to POSIX path of (path to desktop) –> "/Users/me/Desktop/" set theFiles to mdLib’s searchFolders:{thePath} searchString:("kMDItemFSCreationDate >= %@") searchArgs:{aDate} –> returns POSIX path list on getDateInternationalYMDhms(aYear, aMonth, aDay, anHour, aMinute, aSecond) set theNSCalendar to NSCalendar’s currentCalendar() set theDate to theNSCalendar’s dateWithEra:1 |year|:aYear |month|:aMonth |day|:aDay hour:anHour minute:aMinute |second|:aSecond nanosecond:0 return theDate end getDateInternationalYMDhms |
(Visited 28 times, 1 visits today)