AppleScript名:指定のアプリケーションのURL Schemeを取得する |
— Created 2017-07-23 by Takaaki Naganoya — 2017 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" use BridgePlus : script "BridgePlus" –http://piyocast.com/as/archives/4759 load framework set aP to choose file set aURLrec to getAppURLSchemes(aP) of me –> {appName:"Photos", appBundleID:"com.apple.Photos", urlScheme:{"photos"}} on getAppURLSchemes(aP) set aURL to current application’s |NSURL|’s fileURLWithPath:(POSIX path of aP) set aBundle to current application’s NSBundle’s bundleWithURL:aURL set aDict to aBundle’s infoDictionary() set appNameDat to (aDict’s valueForKey:"CFBundleName") as string set bundleIDat to (aDict’s valueForKey:"CFBundleIdentifier") as string set urlSchemes to (aDict’s valueForKey:"CFBundleURLTypes") if urlSchemes is not equal to missing value then set urlList to urlSchemes’s valueForKey:"CFBundleURLSchemes" set urlListFlat to (current application’s SMSForder’s arrayByFlattening:urlList) as list else set urlListFlat to {} end if set aRec to {appName:appNameDat, appBundleID:bundleIDat, urlScheme:urlListFlat} return aRec end getAppURLSchemes |
More from my site
(Visited 97 times, 1 visits today)
Terminalで指定コマンドのman pageを表示する - AppleScript Hole says:
[…] と、いろいろURL Schemeが定義されており、そのうちの1つ、x-man-pageのURL Shcemeを利用して表示させてみました。 […]