AppleScript名:Bundle IDで指定したアプリケーションのローカライズ一覧を取得 |
— Created 2017-11-07 by Takaaki Naganoya — 2017 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" set aRes to getLocalizationsFromBundleID("com.apple.Safari") of me –> {"ar", "Base", "ca", "cs", "da", "de", "el", "en", "es", "es_419", "fi", "fr", "he", "hr", "hu", "id", "it", "ja", "ko", "ms", "nl", "no", "pl", "pt", "pt_PT", "ro", "ru", "sk", "sv", "th", "tr", "uk", "vi", "zh_CN", "zh_TW"} set bRes to getLocalizationsFromBundleID("com.apple.iWork.Pages") of me –> {"ar", "Base", "ca", "cs", "da", "de", "el", "en", "es", "fi", "fr", "he", "hr", "hu", "id", "it", "ja", "ko", "ms", "nl", "no", "pl", "pt", "pt_PT", "ro", "ru", "sk", "sv", "th", "tr", "uk", "vi", "zh_CN", "zh_TW"} set cRes to getLocalizationsFromBundleID("com.adobe.Photoshop") of me –> {"cs", "da", "de", "en-GB", "en", "English", "es", "fi", "fr-CA", "fr", "hu", "it", "ja", "ko", "nb", "nl", "no", "pl", "pt", "ru", "sk", "sv", "tr", "uk", "zh-Hans", "zh-Hant"} set dRes to getLocalizationsFromBundleID("com.adobe.InDesign") of me –> {"cs", "da", "de", "el", "en", "en_GB", "English", "es", "fi", "fr", "hu", "it", "ja", "ko", "nb", "nl", "pl", "pt", "ro", "ru", "sq", "sv", "tr", "uk", "zh_CN", "zh_TW"} set eRes to getLocalizationsFromBundleID("com.adobe.Illustrator") of me –> {"cs", "da", "de", "el", "en", "es", "fi", "fr", "hu", "it", "ja", "ko", "nl", "no", "pl", "pt", "ro", "ru", "sv", "tr", "uk", "zh_CN", "zh_TW"} on getLocalizationsFromBundleID(aBundleID) set aRes to retPathFromBundleID(aBundleID) of me if aRes = false then error "Wrong Bundle ID." return getSpecifiedAppFilesLocalizationListWithDuplication(aRes) of me end getLocalizationsFromBundleID –指定アプリケーションファイルの、指定Localeにおけるローカライズ言語リストを求める。重複を許容 on getSpecifiedAppFilesLocalizationListWithDuplication(appPOSIXpath) set aURL to (current application’s |NSURL|’s fileURLWithPath:appPOSIXpath) set aBundle to current application’s NSBundle’s bundleWithURL:aURL set locList to aBundle’s localizations() return locList as list end getSpecifiedAppFilesLocalizationListWithDuplication on retPathFromBundleID(aBundleID) set aURL to current application’s NSWorkspace’s sharedWorkspace()’s URLForApplicationWithBundleIdentifier:aBundleID if aURL = missing value then return false –Error return aURL’s |path|() as string end retPathFromBundleID |
(Visited 45 times, 1 visits today)