Referencing the current frontmost application window

And it will of course work the same way if the tell block is inside a library, since it is also resolved once and for all during compilation.

I have to bother myself, to look at the apple events now, but I’m reluctant. :slight_smile:

Personally, I’d use the application file id. :slight_smile:

I think you’re right Shane, I was focusing on the wrong subject and forgot the “id” part. Still, apart from the differences in AppleScript, the name of application is just an info.plist entry like an bundle id. So to me, in general, there would be no difference in performance when you ask for an process by name or bundle from launchd (not when I’m in C/Objective-C). AppleScript, again, behaves against all odds. My mistake.

I suspect the explanation is that the name-based references pre-date launched, and are still using pre-launchd APIs, whereas id-based references were introduced after launchd, and use the newer, but perhaps fractionally slower, API. At the same time they introduced the ability to skip the “find the app” dialog.