AppleScript名:指定ファイルのFinder Tagを取得 |
— Created 2014-12-21 by Takaaki Naganoya — 2014 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" set a to choose file set aResList to getFinderTagList(a) of me –> {"ブルー", "レッド"} on getFinderTagList(anAlias) –aliasをNSURLに変換 set aPOSIX to POSIX path of anAlias set aURL to current application’s |NSURL|’s fileURLWithPath:aPOSIX –指定URLから指定の属性(NSURLTagNamesKey)を取得 try set aTargAttr to {current application’s NSURLTagNamesKey} set {attsNSDictionary, theError} to aURL’s resourceValuesForKeys:aTargAttr |error|:(reference) if attsNSDictionary is missing value then error (theError’s localizedDescription() as text) end if –NSURLTagNamesKeyのリストを返す set aList to NSURLTagNamesKey of (attsNSDictionary as list of string or string) return aList as list on error return {} end try end getFinderTagList |
More from my site
(Visited 23 times, 1 visits today)