指定Bundle IDのプロセス存在確認(ASOC)v3

AppleScript名:指定Bundle IDのプロセス存在確認(ASOC)v3
— Created 2015-02-08 by Takaaki Naganoya
— Created 2017-02-26 by Takaaki Naganoya
— 2017 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"
use framework "AppKit"

set aRes to chkAppProcesByBundleID("com.apple.iWork.Keynote")
–> true

on chkAppProcesByBundleID(aBundleID as string)
  set procArray to current application’s NSWorkspace’s sharedWorkspace’s runningApplications()’s valueForKeyPath:"bundleIdentifier"
  
return (procArray’s containsObject:aBundleID) as boolean
end chkAppProcesByBundleID

★Click Here to Open This Script 

Please follow and like us:

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です