AppleScript名:Bundle IDからアプリケーション名称を取得する |
— Created 2017-11-07 by Takaaki Naganoya — 2017 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" use framework "AppKit" set aBundleID to "com.apple.iWork.Keynote2" set aRes to retNameFromBundleID(aBundleID) of me –> "Keynote" on retNameFromBundleID(aBundleID) set aURL to current application’s NSWorkspace’s sharedWorkspace()’s URLForApplicationWithBundleIdentifier:aBundleID if aURL = missing value then return false –Error set aBundle to current application’s NSBundle’s bundleWithURL:aURL set aName to aBundle’s objectForInfoDictionaryKey:(current application’s kCFBundleExecutableKey) return aName as string end retNameFromBundleID |
(Visited 110 times, 1 visits today)