AppleScript名:アプリケーションのBundle IDからアプリのAppleScript対応度を取得する |
— Created 2016-02-08 by Takaaki Naganoya — 2016 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" use framework "AppKit" set aBundleID to "com.apple.Safari" set aPath to retAppScriptabilityFromBundleID(aBundleID) of me –> true –Bundle IDからアプリケーションのScriptabilityをbooleanで返す on retAppScriptabilityFromBundleID(aBundleID) set appPath to current application’s NSWorkspace’s sharedWorkspace()’s absolutePathForAppBundleWithIdentifier:aBundleID if appPath = missing value then return false set aDict to (current application’s NSBundle’s bundleWithPath:appPath)’s infoDictionary() set aRes to aDict’s valueForKey:"NSAppleScriptEnabled" if aRes = missing value then return false return aRes as boolean end retAppScriptabilityFromBundleID |
(Visited 38 times, 1 visits today)