Hi, I need to figure out when the indexing is done, and I
thought the easiest way is to check if the process ‘mdworker.’
If it is active, then the indexing is still going, and when
it goes into sleep (inactive), then indexing is done.
For that, I need to access the list of active processes (not
all processes) and see if ‘mdworker’ is there on the list.
I have used the code below, but it does not work since it
looks up every active/inactive process. I need to get the active ones.
Tell application “System Events”
If
exists application process “mdworker” then
I tried with shell scripting with command ‘ps’,
but the process status showing there is very unstable (keeps going into idle
and coming back out to active status)
So I thought the best way is to access the active process
list on the Activity Monitor since it is very stable there, but I am
having difficult time figuring out that by using apple script.
Any help would be very appreciated. I am a beginner to apple
script, so if possible, if you could write some code that does what I need, I
would really appreciate. ( I need to get this thing done fairly soon, so
I am quite desperate)
Thanks!