AppleScript名:選択したファイルのローカライズ名を取得する v2 |
— Created 2014-12-14 by Takaaki Naganoya — 2014 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" property |NSURL| : a reference to current application’s |NSURL| property NSURLLocalizedNameKey : a reference to current application’s NSURLLocalizedNameKey set a to choose folder –> alias "Macintosh HD:Users:me:Music:" set b to getLocalizedNameFor(a) –> {true, "ミュージック"} on getLocalizedNameFor(aPath) set anNSURL to |NSURL|’s fileURLWithPath:(POSIX path of aPath) set {theResult, theValue} to anNSURL’s getResourceValue:(reference) forKey:(NSURLLocalizedNameKey) |error|:(missing value) return {theResult, theValue as string} as list end getLocalizedNameFor |
More from my site
(Visited 20 times, 1 visits today)