AppleScript名:Metadata Lib v2.0の命令をひととおりチェック |
— Created 2017-09-23 by Takaaki Naganoya — 2017 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" use mdLib : script "Metadata Lib" version "2.0.0" –https://www.macosxautomation.com/applescript/apps/ –mdfind set theFolder to path to desktop set sStr to "kMDItemResolutionHeightDPI == %@ && kMDItemResolutionWidthDPI == %@ && NOT (kMDItemContentTypeTree contains %@)" set fRes to perform search in folders {theFolder} predicate string sStr search arguments {144, 144, "com.apple.icns"} log fRes –> {"/Users/me/Desktop/From Desktop 2018.1.9/FromDesktop/スクリーンショット 2015-12-18 13.02.14.png"} –scope strings set aRes to metadata scope strings log aRes –> {"kMDQueryScopeHome", "kMDQueryScopeNetwork", "kMDQueryScopeComputer", "kMDQueryScopeAllIndexed", "kMDQueryScopeComputerIndexed", "kMDQueryScopeNetworkIndexed"} –https://developer.apple.com/documentation/coreservices/file_metadata/mdquery/query_search_scope_keys?preferredLanguage=occ –mdls set aFile to choose file with prompt "" set aRes to fetch metadata for item aFile log aRes –> {kMDItemFSCreatorCode:0, kMDItemFSFinderFlags:0, kMDItemFSContentChangeDate:date "2018年3月14日水曜日 1:32:07", kMDItemFSName:"0261F5E3-9BE4-4007-B7D8-10E56E13FB24.dot", kMDItemDisplayName:"0261F5E3-9BE4-4007-B7D8-10E56E13FB24.dot", kMDItemFSInvisible:false, kMDItemFSSize:2506, kMDItemFSOwnerUserID:504, kMDItemDateAdded:date "2018年3月14日水曜日 1:32:07", kMDItemPhysicalSize:4096, kMDItemKind:"Microsoft Word 97 – 2004 テンプレート (.dot)", _kMDItemOwnerUserID:504, kMDItemContentTypeTree:{"public.item", "public.data", "com.microsoft.word.dot"}, kMDItemFSTypeCode:0, kMDItemFSIsExtensionHidden:false, kMDItemLogicalSize:2506, kMDItemFSLabel:0, kMDItemContentModificationDate:date "2018年3月14日水曜日 1:32:07", kMDItemUseCount:2, kMDItemContentType:"com.microsoft.word.dot", kMDItemFSOwnerGroupID:80, kMDItemContentCreationDate:date "2018年3月14日水曜日 1:32:07", kMDItemUsedDates:{date "2018年3月14日水曜日 0:00:00"}, kMDItemFSCreationDate:date "2018年3月14日水曜日 1:32:07"} –既存のsavedsearchから情報を読み取る set sFile to choose file of type {"com.apple.finder.smart-folder"} with prompt "Select saved search file (purple folder icon)" default location (path to home folder) search strings from saved search (POSIX path of sFile) –> {"((_kMDItemGroupId = 11) && (kMDItemContentCreationDate > 489942000))", "_kMDItemGroupId == \"11\" AND kMDItemContentCreationDate > \"489942000\""} |
More from my site
(Visited 97 times, 1 visits today)