Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

peregrinare

macrumors newbie
Original poster
Mar 4, 2012
5
0
Hi,

Hope you guys can help. I googled and checked this forum, but no luck. Please see below. I did turn on "Enable access for assistive devices." Thanks.


The following used to work:

tell application "System Events" to get name of process whose frontmost is true

Now I get this error:

error "Can’t get name of process." number -1728 from name of «class prcs»
 
I get the same error and I'm running Leopard. Don't know if this is what you want but this works :

Code:
tell application "System Events" to get name of every process whose frontmost is true
 

Attachments

  • Picture 2.png
    Picture 2.png
    38.1 KB · Views: 73
I get the same error and I'm running Leopard.

I see the same error on Tiger and Snow Leopard.

I see no way the originally posted code could work. There's a word missing before "process". Qualifiers like "first" or "last" would work, and they have the same result. Leaving the word out doesn't work.

This also works:
Code:
tell application "System Events" to get name of processes whose frontmost is true
Note the plural processes, not the singular. And the output is a list, not a single string.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.