[bundleWithIdentifier]UTIから各種情報を取得する
UTIからインストール先を調べられるのは良い♪
#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions
property refMe : a reference to current application
####設定項目
##UTI
set strUTI to "com.apple.Safari" as text
set ocidAppBundle to refMe's NSBundle's bundleWithIdentifier:strUTI
###
set ocidAppBundlePath to ocidAppBundle's bundlePath()
log ocidAppBundlePath as text
(*/System/Volumes/Preboot/Cryptexes/App/System/Applications/Safari.app*)
###
set ocidAppBundlePathURL to ocidAppBundle's bundleURL()
log ocidAppBundlePathURL's absoluteString() as text
(*file:///System/Volumes/Preboot/Cryptexes/App/System/Applications/Safari.app/*)
##
set ocidAppName to (ocidAppBundle's objectForInfoDictionaryKey:"CFBundleName")
log ocidAppName as text
(*Safari*)
set ocidAppDisplayName to (ocidAppBundle's objectForInfoDictionaryKey:"CFBundleDisplayName")
log ocidAppDisplayName as text
(*Safari*)
set ocidAppVerText to ocidAppBundle's infoDictionary()'s objectForKey:"CFBundleShortVersionString"
log ocidAppVerText as text
(*16.3*)
###
set ocidBundleInfo to ocidAppBundle's infoDictionary()
set ocidAllKeys to ocidBundleInfo's allKeys()
log ocidAllKeys as list
(*DTCompiler, NSAppleScriptEnabled, CFBundleInfoDictionaryVersion, DTPlatformVersion, CFBundleIconFile, CFBundleName, DTSDKName, NSUserActivityTypes, NSServices, CKSharingSupported, NSPrincipalClass, LSApplicationCategoryType, CFBundleDisplayName, CFBundleDocumentTypes, DTSDKBuild, CFBundleShortVersionString, CFBundleSupportedPlatforms, BuildMachineOSBuild, DTPlatformBuild, CFBundlePackageType, DTXcodeBuild, CFBundleDevelopmentRegion, UTExportedTypeDeclarations, CFBundleVersion, NSSpeechRecognitionUsageDescription, CFBundleNumericVersion, CFBundleGetInfoString, NSSupportsSuddenTermination, LSFileQuarantineEnabled, NSSupportsAutomaticTermination, OSAScriptingDefinition, NSMainNibFile, ASWebAuthenticationSessionWebBrowserSupportCapabilities, CFBundleIdentifier, HPDHelpProjectIdentifier, DTXcode, CFBundleIconName, CFBundleHelpBookName, CFBundleHelpBookFolder, Application-Group, CFBundleExecutable, NSExtensionSDK, LSMinimumSystemVersion, CFBundleSignature, NSLocationUsageDescription, DTPlatformName, CFBundleURLTypes*)
repeat with itemKey in ocidAllKeys
log itemKey as text
try
log (ocidBundleInfo's valueForKey:itemKey) as text
end try
end repeat
| 固定リンク
「NSBundle」カテゴリの記事
- [Plist]Acrobat ReaderのSCA(single client app) Unified App版判定(その2 AppleScript:ASOC)(2025.01.06)
- バンドルIDからアプリケーションの実行バイナリーへのパスを調べる(2024.12.30)
- バンドルIDからアプリケーションのバーション(Launch Services Register との相違のチェックも入れる)(2024.11.22)
- バンドルIDからアプリケーションのバーション(2024.11.22)
- バンドルIDからアプリケーションのパス(2024.01.24)
「UTType」カテゴリの記事
- シンボリックリンクのUTIの取得(2024.12.02)
- [UTType]処理対象のUTI(ファイルタイプ)か?チェックする 複数UTIでチェックする(2024.10.03)
- [UTType]処理対象のUTI(ファイルタイプ)か?チェックする(2024.09.30)
- UTI(uniform type identifier)の取得 ツリー構造付き 少し修正(2024.06.19)
- UTI(uniform type identifier)の取得 ツリー構造付き(2024.05.23)