AppleScript NSBundle

バンドルIDからアプリケーションのパス


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "UniformTypeIdentifiers"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application

########################
## クリップボードの中身取り出し
########################
###初期化
set ocidPasteboard to refMe's NSPasteboard's generalPasteboard()
set ocidPastBoardTypeArray to ocidPasteboard's types
###テキストがあれば
set boolContain to ocidPastBoardTypeArray's containsObject:"public.utf8-plain-text"
if boolContain = true then
  ###値を格納する
  tell application "Finder"
    set strReadString to (the clipboard as text) as text
  end tell
  ###Finderでエラーしたら
else
  set boolContain to ocidPastBoardTypeArray's containsObject:"NSStringPboardType"
  if boolContain = true then
    set ocidReadString to ocidPasteboard's readObjectsForClasses:({refMe's NSString}) options:(missing value)
    set strReadString to ocidReadString as text
  else
log "テキストなし"
    set strReadString to "1" as text
  end if
end if
##############################
#####ダイアログ
##############################
tell current application
  set strName to name as text
end tell
####スクリプトメニューから実行したら
if strName is "osascript" then
  tell application "Finder"
activate
  end tell
else
  tell current application
activate
  end tell
end if
set strMes to ("com.domain.app形式のバンドルIDを入力") as text
set aliasIconPath to POSIX file "/System/Applications/Calculator.app/Contents/Resources/AppIcon.icns" as alias
try
  set recordResult to (display dialog strMes with title "入力してください" default answer strReadString buttons {"OK", "キャンセル"} default button "OK" with icon aliasIconPath giving up after 10 without hidden answer) as record
on error
log "エラーしました"
return
end try

if "OK" is equal to (button returned of recordResult) then
  set strReturnedText to (text returned of recordResult) as text
else if (gave up of recordResult) is true then
return "時間切れです"
else
return "キャンセル"
end if
###NSStringに格納
set ocidResponseText to (refMe's NSString's stringWithString:(strReturnedText))
###タブと改行を除去しておく
set ocidTextM to refMe's NSMutableString's alloc()'s initWithCapacity:(0)
ocidTextM's appendString:(ocidResponseText)
##改行除去
set ocidTextM to ocidTextM's stringByReplacingOccurrencesOfString:("\n") withString:("")
set ocidTextM to ocidTextM's stringByReplacingOccurrencesOfString:("\r") withString:("")
##タブ除去
set ocidTextM to ocidTextM's stringByReplacingOccurrencesOfString:("\t") withString:("")
##出力用のNSString
set strBundleID to ocidTextM as text
log strBundleID
set ocidURL to doGetBundleID2AppURL(strBundleID)
set strPath to (ocidURL's |path|) as text
set strPathURL to ocidURL's absoluteString() as text

#####ダイアログを前面に
tell current application
  set strName to name as text
end tell
####スクリプトメニューから実行したら
if strName is "osascript" then
  tell application "Finder" to activate
else
  tell current application to activate
end if

###ダイアログ
set recordResult to (display dialog ("戻り値です\r" & strPathURL) with title "戻り値" default answer strPath buttons {"クリップボードにコピー", "キャンセル", "OPEN"} default button "OPEN" cancel button "キャンセル" giving up after 30 with icon aliasIconPath without hidden answer)
###クリップボードコピー
set strText to text returned of recordResult as text
if button returned of recordResult is "クリップボードにコピー" then
  ####ペーストボード宣言
  set appPasteboard to refMe's NSPasteboard's generalPasteboard()
  set ocidText to (refMe's NSString's stringWithString:(strText))
appPasteboard's clearContents()
appPasteboard's setString:(ocidText) forType:(refMe's NSPasteboardTypeString)
else if button returned of recordResult is "OPEN" then
  tell application "Finder"
    set aliasFilePath to POSIX file strText as alias
open aliasFilePath
  end tell
end if


###################################
### バンドルIDからアプリケーションURL
###################################
to doGetBundleID2AppURL(argBundleID)
  set strBundleID to argBundleID as text
  set appSharedWorkspace to refMe's NSWorkspace's sharedWorkspace()
  ##バンドルIDからアプリケーションのURLを取得
  set ocidAppBundle to (refMe's NSBundle's bundleWithIdentifier:(strBundleID))
  if ocidAppBundle ≠ (missing value) then
    set ocidAppPathURL to ocidAppBundle's bundleURL()
  else if ocidAppBundle = (missing value) then
    set ocidAppPathURL to (appSharedWorkspace's URLForApplicationWithBundleIdentifier:(argBundleID))
  end if
  ##予備(アプリケーションのURL)
  if ocidAppPathURL = (missing value) then
    tell application "Finder"
      try
        set aliasAppApth to (application file id strBundleID) as alias
        set strAppPath to (POSIX path of aliasAppApth) as text
        set strAppPathStr to refMe's NSString's stringWithString:(strAppPath)
        set strAppPath to strAppPathStr's stringByStandardizingPath()
        set ocidAppPathURL to refMe's NSURL's alloc()'s initFileURLWithPath:(strAppPath) isDirectory:true
      on error
return "アプリケーションが見つかりませんでした"
      end try
    end tell
  end if
return ocidAppPathURL
end doGetBundleID2AppURL

|

[localizedStringForKey]ローカライズされたアプリケーション名の取得

サンプルは『Clock.app』-->『時計』

【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application

###パス
set strFilePath to "/System/Applications/Clock.app" as text
set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set ocidFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath) isDirectory:false)
###バンドル
set ocidAppBundle to refMe's NSBundle's bundleWithURL:(ocidFilePathURL)
###取得
set ocidBundleDisplayNameLocalizable to ocidAppBundle's localizedStringForKey:("CFBundleDisplayName") value:("") table:("InfoPlist")
log ocidBundleDisplayNameLocalizable as text
-->(*時計*)


|

バンドルIDから再起動


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#com.cocolog-nifty.quicktimer.icefloe
#バンドルIDのアプリケーションをリスタート
#起動していない場合は起動
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "Appkit"
use framework "UniformTypeIdentifiers"
use scripting additions
property refMe : a reference to current application


set strBundleID to "com.microsoft.VSCode" as text

log (doRestartApp2BundleID(strBundleID)) as text



################################
#### doRestartApp2BundleID
################################
to doRestartApp2BundleID(argBundleID)
  set strBundleID to argBundleID as text
  set ocidAppListArray to refMe's NSRunningApplication's runningApplicationsWithBundleIdentifier:(strBundleID)
  if (count of ocidAppListArray) ≠ 0 then
    repeat with itemAppListArray in ocidAppListArray
      set booleDone to itemAppListArray's terminate()
    end repeat
  end if
  repeat 10 times
    delay 1
    set ocidAppListArray to refMe's NSRunningApplication's runningApplicationsWithBundleIdentifier:(strBundleID)
    if (count of ocidAppListArray) = 0 then
      ###
      set ocidAppPathURL to doGetBundleID2AppURL(strBundleID)
      tell current application
set strName to name as text
      end tell
      set appSharedWorkspace to refMe's NSWorkspace's sharedWorkspace()
      set ocidOpenConfig to refMe's NSWorkspaceOpenConfiguration's configuration
(ocidOpenConfig's setActivates:(refMe's NSNumber's numberWithBool:true))
      if strName is "osascript" then
set boolDone to (run script (appSharedWorkspace's openApplicationAtURL:(ocidAppPathURL) configuration:(ocidOpenConfig) completionHandler:(missing value)))
      else
set boolDone to (activate (appSharedWorkspace's openApplicationAtURL:(ocidAppPathURL) configuration:(ocidOpenConfig) completionHandler:(missing value)))
      end if
return "手動で起動"
    else
      exit repeat
    end if
  end repeat
return "起動"
end doRestartApp2BundleID


###################################
### バンドルIDからアプリケーションURL
###################################
to doGetBundleID2AppURL(argBundleID)
  set strBundleID to argBundleID as text
  set appSharedWorkspace to refMe's NSWorkspace's sharedWorkspace()
  ##バンドルIDからアプリケーションのURLを取得
  set ocidAppBundle to (refMe's NSBundle's bundleWithIdentifier:(argBundleID))
  if ocidAppBundle ≠ (missing value) then
    set ocidAppPathURL to ocidAppBundle's bundleURL()
  else if ocidAppBundle = (missing value) then
    set ocidAppPathURL to (appSharedWorkspace's URLForApplicationWithBundleIdentifier:(argBundleID))
  end if
  ##予備(アプリケーションのURL)
  if ocidAppPathURL = (missing value) then
    tell application "Finder"
      try
set aliasAppApth to (application file id strBundleID) as alias
set strAppPath to (POSIX path of aliasAppApth) as text
set strAppPathStr to refMe's NSString's stringWithString:(strAppPath)
set strAppPath to strAppPathStr's stringByStandardizingPath()
set ocidAppPathURL to refMe's NSURL's alloc()'s initFileURLWithPath:(strAppPath) isDirectory:true
      on error
return "アプリケーションが見つかりませんでした"
      end try
    end tell
  end if
return ocidAppPathURL
end doGetBundleID2AppURL

|

[localizedInfoDictionary]アプリケーションの表示名


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#com.cocolog-nifty.quicktimer.icefloe
#ランチパッドの縦横行列数の変更
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "Appkit"
use framework "UniformTypeIdentifiers"
use scripting additions
property refMe : a reference to current application

set strBundleID to ("com.apple.ScriptEditor2") as text

##バンドルIDからアプリケーションのURLを取得
set ocidAppBundle to (refMe's NSBundle's bundleWithIdentifier:(strBundleID))
set ocidLoalisedDict to ocidAppBundle's localizedInfoDictionary()
log ocidLoalisedDict's allKeys() as list
-->(*script, plain text, script bundle, scripting addition, dictionary document, plugin, application bundle, text, CFBundleName, application, CFBundleDisplayName*)

set ocidAppName to ocidLoalisedDict's valueForKey:("CFBundleDisplayName")
log ocidAppName as text
-->(*スクリプトエディタ*)


|

バンドルIDから再起動


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application


set strBundleID to "com.apple.dock"

########################
## 再起動
########################
set appSharedWorkspace to refMe's NSWorkspace's sharedWorkspace()
##バンドルからアプリケーションのURLを取得
set ocidAppBundle to (refMe's NSBundle's bundleWithIdentifier:(strBundleID))
if ocidAppBundle ≠ (missing value) then
  set ocidAppPathURL to ocidAppBundle's bundleURL()
else if ocidAppBundle = (missing value) then
  set ocidAppPathURL to (appSharedWorkspace's URLForApplicationWithBundleIdentifier:(strBundleID))
end if
##予備(アプリケーションのURL)
if ocidAppPathURL = (missing value) then
  tell application "Finder"
    try
      set aliasAppApth to (application file id strBundleID) as alias
      set strAppPath to POSIX path of aliasAppApth as text
      set strAppPathStr to refMe's NSString's stringWithString:(strAppPath)
      set strAppPath to strAppPathStr's stringByStandardizingPath()
      set ocidAppPathURL to refMe's NSURL's alloc()'s initFileURLWithPath:(strAppPath) isDirectory:true
    on error
return "アプリケーションが見つかりませんでした"
    end try
  end tell
end if
##Dock終了
set ocidRunningApplication to refMe's NSRunningApplication
###起動中のすべてのリスト
set ocidAppArray to (ocidRunningApplication's runningApplicationsWithBundleIdentifier:(strBundleID))
###複数起動時も順番に終了
repeat with itemAppArray in ocidAppArray
  ###終了
itemAppArray's terminate()
end repeat
##1秒まって終了を確認
delay 1
##終了できない場合は強制終了
repeat with itemAppArray in ocidAppArray
  set boolTerminate to itemAppArray's terminated
  if boolTerminate = false then
itemAppArray's forceTerminate()
  end if
end repeat

###起動
set ocidOpenConfig to refMe's NSWorkspaceOpenConfiguration's configuration
###コンフィグ
(ocidOpenConfig's setActivates:(refMe's NSNumber's numberWithBool:true))
###起動
(appSharedWorkspace's openApplicationAtURL:(ocidAppPathURL) configuration:(ocidOpenConfig) completionHandler:(missing value))

return "再起動"

|

システム設定のパネルを指定して開く(改良)


【スクリプトエディタで開く】|

#!/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 framework "AppKit"
use framework "UniformTypeIdentifiers"
use scripting additions

property refMe : a reference to current application

set appShardWorkspace to refMe's NSWorkspace's sharedWorkspace()

###システム設定のバンドルID
set strBundleID to "com.apple.systempreferences" as text
###システム設定のNSBundle
set ocidAppBundle to refMe's NSBundle's bundleWithIdentifier:(strBundleID)
if ocidAppBundle is not (missing value) then
  ###URLを取得
  set ocidAppPathURL to ocidAppBundle's bundleURL()
else
  ###URLを取得
  set ocidAppPathURL to appShardWorkspace's URLForApplicationWithBundleIdentifier:(strBundleID)
end if
##ワークスペースに渡すURLのリスト
set ocidOpenUrlArray to refMe's NSMutableArray's alloc()'s initWithCapacity:0
##com.apple.preferences.configurationprofilesのURL
set ocidURLComponents to refMe's NSURLComponents's alloc()'s init()
ocidURLComponents's setScheme:("x-apple.systempreferences")
ocidURLComponents's setPath:("com.apple.preferences.configurationprofiles")
set ocidOpenURL to ocidURLComponents's |URL|
set strPanelURL to (ocidOpenURL's absoluteString()) as text
##URLリストに追加
ocidOpenUrlArray's insertObject:(ocidOpenURL) atIndex:0
##OPENコンフィグ アクティベートのみ設定
set ocidOpenConfig to refMe's NSWorkspaceOpenConfiguration's configuration
ocidOpenConfig's setActivates:(refMe's NSNumber's numberWithBool:true)
## システム設定でプロファイルのURLを開く
##これでも良いし
appShardWorkspace's openURLs:(ocidOpenUrlArray) withApplicationAtURL:(ocidAppPathURL) configuration:(ocidOpenConfig) completionHandler:(missing value)
##こっちでも同じ
appShardWorkspace's openURL:(ocidOpenURL)


|

バンドルIDからアプリケーションのインストールURLを取得して開く


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "AppKit"
use framework "UniformTypeIdentifiers"
use scripting additions
property refMe : a reference to current application

set strBundleID to "com.apple.finder.Open-AirDrop" as text

set appSharedWorkspace to refMe's NSWorkspace's sharedWorkspace()
set ocidAppBundle to (refMe's NSBundle's bundleWithIdentifier:(strBundleID))
if ocidAppBundle ≠ (missing value) then
  set ocidAppPathURL to ocidAppBundle's bundleURL()
else if ocidAppBundle = (missing value) then
  set ocidAppPathURL to (appSharedWorkspace's URLForApplicationWithBundleIdentifier:(strBundleID))
end if
if ocidAppPathURL = (missing value) then
  tell application "Finder"
    try
      set aliasAppApth to (application file id strBundleID) as alias
    on error
return "アプリケーションが見つかりませんでした"
    end try
  end tell
  set strAppPath to POSIX path of aliasAppApth as text
  set strAppPathStr to refMe's NSString's stringWithString:(strAppPath)
  set strAppPath to strAppPathStr's stringByStandardizingPath()
  set ocidAppPathURL to refMe's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath) isDirectory:true
end if

set ocidOpenConfig to refMe's NSWorkspaceOpenConfiguration's configuration
(ocidOpenConfig's setActivates:(refMe's NSNumber's numberWithBool:true))
(appSharedWorkspace's openApplicationAtURL:(ocidAppPathURL) configuration:(ocidOpenConfig) completionHandler:(missing value))


|

アプリケーションを『隠して』非表示で起動(考え中)

コマンドラインからだと起動しない なんで?=考え中

【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "AppKit"
use framework "UniformTypeIdentifiers"
use scripting additions

property refMe : a reference to current application

###設定項目 フォントブック
property strBundleID : "com.apple.FontBook"
####################################
###アプリケーションのインストール先URLを取得
####################################
set appFileManager to refMe's NSFileManager's defaultManager()
set appNSWorkspace to refMe's NSWorkspace's sharedWorkspace()
##NSBundleで取得出来なければNSWorkspaceで取得
set ocidAppBundle to refMe's NSBundle's bundleWithIdentifier:(strBundleID)
if ocidAppBundle ≠ (missing value) then
  set ocidAppBundlePath to ocidAppBundle's bundlePath()
  set ocidAppPath to ocidAppBundlePath's stringByStandardizingPath
  set ocidAppPathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidAppPath) isDirectory:false)
else if ocidAppBundle = (missing value) then
  set appNSWorkspace to refMe's NSWorkspace's sharedWorkspace()
  set ocidAppPathURL to appNSWorkspace's URLForApplicationWithBundleIdentifier:(strBundleID)
end if
####################################
###アプリケーションをHIDEで起動
####################################
set ocidFalse to (refMe's NSNumber's numberWithBool:false)
set ocidTrue to (refMe's NSNumber's numberWithBool:true)

set ocidOpenConfig to refMe's NSWorkspaceOpenConfiguration's configuration
ocidOpenConfig's setHides:(ocidTrue)
ocidOpenConfig's setActivates:(ocidFalse)
ocidOpenConfig's setRequiresUniversalLinks:(ocidFalse)
appNSWorkspace's openApplicationAtURL:(ocidAppPathURL) configuration:(ocidOpenConfig) completionHandler:(missing value)
(*
set ocidComponents to refMe's NSURLComponents's alloc()'s init()
ocidComponents's setScheme:("fontbook")
ocidComponents's setPath:("/")
set ocidAppSchemeURL to ocidComponents's |URL|
log ocidAppSchemeURL's absoluteString() as text

appNSWorkspace's openURLs:({ocidAppSchemeURL}) withApplicationAtURL:(ocidAppPathURL) configuration:(ocidOpenConfig) completionHandler:(missing value)
*)
####################################
###アプリケーションを隠す
####################################
set ocidRunningApplication to refMe's NSRunningApplication
set ocidAppArray to (ocidRunningApplication's runningApplicationsWithBundleIdentifier:(strBundleID))
repeat with itemAppArray in ocidAppArray
itemAppArray's hide()
end repeat


return "処理終了"


|

[executableArchitectures]ARMか?ユニバーサルか?


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

property refMe : a reference to current application

set ocidBundle to refMe's NSBundle's bundleWithIdentifier:("com.apple.dt.Xcode")

set ocidArchArray to ocidBundle's executableArchitectures()
log className() of ocidArchArray as text
repeat with itemArch in ocidArchArray
  if (itemArch as text) is "16777223" then
    log "INTEL"
  else if (itemArch as text) is "16777228" then
    log "ARM"
  end if
end repeat

|

[CFBundleVersion]アプリケーションのバージョンを取得する


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.6"
use framework "Foundation"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application

set appFileManager to refMe's NSFileManager's defaultManager()
set appNSWorkspace to refMe's NSWorkspace's sharedWorkspace()

###サポートするアプリのUTI com.google.Chrome
set strUTI to "com.adobe.Reader"

###バンドル
set ocidAppBundle to refMe's NSBundle's bundleWithIdentifier:(strUTI)
###インストール先の取得
if ocidAppBundle is (missing value) then
  set ocidAppBundlePathURL to appNSWorkspace's URLForApplicationWithBundleIdentifier:(strUTI)
  set ocidAppBundle to refMe's NSBundle's bundleWithURL:(ocidAppBundlePathURL)
end if
set ocidInfoDict to ocidAppBundle's infoDictionary
###全部見る時用
set ocidKeyArray to ocidInfoDict's allKeys()
repeat with itemKey in ocidKeyArray
  log itemKey as text
  set ocidKeyValue to (ocidInfoDict's valueForKey:(itemKey))
  log ocidKeyValue as list
end repeat
###特定のキーのみ
set ocidCFBundleVersion to (ocidInfoDict's valueForKey:("CFBundleVersion"))
log ocidCFBundleVersion as text


return ocidCFBundleVersion as text


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.6"
use framework "Foundation"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application

set appFileManager to refMe's NSFileManager's defaultManager()
set appNSWorkspace to refMe's NSWorkspace's sharedWorkspace()

###サポートするアプリのUTI com.google.Chrome
set strUTI to "com.adobe.Reader"

###バンドル
set ocidAppBundle to refMe's NSBundle's bundleWithIdentifier:(strUTI)
###インストール先の取得
if ocidAppBundle is not (missing value) then
  set ocidAppBundlePathURL to ocidAppBundle's bundleURL()
  set strFilePath to ocidAppBundlePathURL's |path|() as text
else
  set ocidAppBundlePathURL to appNSWorkspace's URLForApplicationWithBundleIdentifier:(strUTI)
  set ocidAppBundle to refMe's NSBundle's bundleWithURL:(ocidAppBundlePathURL)
  set strFilePath to ocidAppBundlePathURL's |path|() as text
end if
###PLISTのURLを取得して
set ocidPlistPathURL to ocidAppBundlePathURL's URLByAppendingPathComponent:("Contents/Info.plist") isDirectory:false
###読み込む
set ocidPlistDict to refMe's NSMutableDictionary's alloc()'s initWithContentsOfURL:(ocidPlistPathURL)
set ocidBundleName to ocidPlistDict's valueForKey:("CFBundleName")
set ocidBundleVersion to ocidPlistDict's valueForKey:("CFBundleVersion")
set ocidBuild to ocidPlistDict's valueForKey:("DTSDKBuild")
set ocidShortVersionString to ocidPlistDict's valueForKey:("CFBundleShortVersionString")
###クローム用
set ocidChannelID to ocidPlistDict's valueForKey:("KSChannelID")
###Acrobat用
set ocidTrackName to ocidPlistDict's valueForKey:("TrackName")

return ocidShortVersionString as text



|

その他のカテゴリー

Acrobat Acrobat Annotation Acrobat Dialog Acrobat Form Acrobat JS Acrobat Open Acrobat Plugin Acrobat python Acrobat Reader Acrobat Sequ Acrobat Stamps Admin Admin Account Admin Apachectl Admin configCode Admin Device Management Admin LaunchServices Admin Locationd Admin loginitem Admin Maintenance Admin Permission Admin Pkg Admin Power Management Admin Printer Admin SetUp Admin SMB Admin System Information Admin Tools Admin Users Admin Volumes Adobe Apple AppleScript AppleScript Guide AppleScript Accessibility AppleScript AppKit AppleScript Applications AppleScript AppStore AppleScript Archive AppleScript Attributes AppleScript Automator AppleScript AVAsset AppleScript AVconvert AppleScript AVFoundation AppleScript AVURLAsset AppleScript BackUp AppleScript Barcode AppleScript Bash AppleScript Basic AppleScript Basic Path AppleScript Bluetooth AppleScript BOX AppleScript Browser AppleScript Calendar AppleScript CD/DVD AppleScript Choose AppleScript Chrome AppleScript CIImage AppleScript CloudStorage AppleScript Color AppleScript com.apple.LaunchServices.OpenWith AppleScript Console AppleScript Contacts AppleScript CotEditor AppleScript CURL AppleScript current application AppleScript Date&Time AppleScript delimiters AppleScript Desktop AppleScript Device AppleScript Disk AppleScript do shell script AppleScript Dock AppleScript DropBox AppleScript eMail AppleScript Encode Decode AppleScript Error AppleScript EXIFData AppleScript ffmpeg AppleScript File AppleScript Finder AppleScript Firefox AppleScript Folder AppleScript Fonts AppleScript GIF AppleScript HTML AppleScript Icon AppleScript Illustrator AppleScript Image Events AppleScript Image2PDF AppleScript ImageOptim Applescript iWork AppleScript Javascript AppleScript Jedit AppleScript Json AppleScript Label AppleScript List AppleScript locationd AppleScript LRC AppleScript LSSharedFileList AppleScript m3u8 AppleScript MakePDF AppleScript Map AppleScript Math AppleScript Microsoft AppleScript Microsoft Edge AppleScript Microsoft Excel AppleScript Mobileconfig AppleScript Mouse AppleScript Movie AppleScript Music AppleScript NetWork AppleScript Notes AppleScript NSArray AppleScript NSBitmapImageRep AppleScript NSBundle AppleScript NSCFBoolean AppleScript NSCharacterSet AppleScript NSColor AppleScript NSColorList AppleScript NSData AppleScript NSDictionary AppleScript NSError AppleScript NSEvent AppleScript NSFileAttributes AppleScript NSFileManager AppleScript NSFont AppleScript NSFontManager AppleScript NSImage AppleScript NSIndex AppleScript NSKeyedArchiver AppleScript NSKeyedUnarchiver AppleScript NSLocale AppleScript NSMutableArray AppleScript NSMutableDictionary AppleScript NSMutableString AppleScript NSNotFound AppleScript NSNumber AppleScript NSOpenPanel AppleScript NSPasteboard AppleScript NSPDFImageRep AppleScript NSpoint AppleScript NSPredicate AppleScript NSRange AppleScript NSRegularExpression AppleScript NSRunningApplication AppleScript NSScreen AppleScript NSSize AppleScript NSString AppleScript NSStringCompareOptions AppleScript NSTask AppleScript NSTimeZone AppleScript NSURL AppleScript NSURL File AppleScript NSURLBookmark AppleScript NSURLComponents AppleScript NSURLResourceKey AppleScript NSUserDefaults AppleScript NSUUID AppleScript NSView AppleScript NSWorkspace AppleScript Numbers AppleScript OAuth AppleScript ObjC AppleScript OneDrive AppleScript Osax AppleScript PDF AppleScript PDFAnnotationWidget AppleScript PDFContext AppleScript PDFDisplayBox AppleScript PDFDocumentPermissions AppleScript PDFKit AppleScript PDFnUP AppleScript PDFOutline AppleScript Photos AppleScript Photoshop AppleScript Plist System Events AppleScript PostScript AppleScript prefPane AppleScript Preview AppleScript Python AppleScript QR AppleScript QR Decode AppleScript QuickLook AppleScript QuickTime AppleScript record AppleScript Regular Expression AppleScript Reminders AppleScript ReName AppleScript Repeat AppleScript RTF AppleScript Safari AppleScript SaveFile AppleScript ScreenCapture AppleScript ScreenSaver AppleScript Script Editor AppleScript Script Menu AppleScript Shortcuts AppleScript Shortcuts Events AppleScript Sort AppleScript Sound AppleScript Spotlight AppleScript SRT AppleScript StandardAdditions AppleScript stringByApplyingTransform AppleScript System Events AppleScript System Settings AppleScript TemporaryItems AppleScript Terminal AppleScript Text AppleScript Text CSV AppleScript Text TSV AppleScript TextEdit AppleScript Translate AppleScript Trash AppleScript Twitter AppleScript UI AppleScript Unit Conversion AppleScript UTType AppleScript valueForKeyPath AppleScript Video AppleScript VisionKit AppleScript Visual Studio Code AppleScript webarchive AppleScript webp AppleScript Wifi AppleScript XML AppleScript XML EPUB AppleScript XML OPML AppleScript XML Plist AppleScript XML RSS AppleScript XML SVG AppleScript XML TTML AppleScript XML webloc AppleScript YouTube AppleScript Zero Suppress Applications Barcode OnLine Tools CityCode Design iPhone List Logs lsappinfo Memo Music perl PlistBuddy pluginkit postalcode ReadMe SF Symbols character id SF Symbols Entity sips Skype Slack sqlite TCC Tools Typography Video Wacom zoom