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

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -