osx - Using apple script to find out and compare process path by PID -


i using apple script find process pid name, ...

set appname "kkk"  tell application "system events"      set processpid (unix id of processes name appname) end tell 

with script, can know pids of processes name "kkk".

but have question here.

for example, there has 3 "kkk" process, "/foldera/kkk", "folderb/kkk", "folderc/kkk"

i want kill process of "/foldera/kkk", need know pid belong "/foldera/kkk".

after run script, can 3 pids, can in apple script distinguish pid want? (maybe process path pid?)

thank you

instead of name check path of application, example checking messages.app.

set apppath "/applications/messages.app"  tell application "system events"     set processpid (unix id of 1st process posix path of application file apppath) end tell 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -