Missing dialog

I use this code to get name of front most app to be used with display dialog:

 tell application "System Events" to set frontapp to displayed name of first process whose frontmost is true
tell app frontapp to display dialog...

Only problem with this is that if frontapp is process which don’t appear in Dock, then it don’t show dialog at all.

I think this does not work…
I tried it with launch bar, I startet it up without a dock icon
started this script from script editor and activated launchbar right away

delay 5
tell application "System Events" to get properties of every process
tell application (path to frontmost application as text)
	display dialog (path to frontmost application as text)
end tell

Then I took a look to the output of the script…

The problem is:
Apps without a Dock-icon donnot have a menu bar, so their frontmost property will never be set.

So only this worked here for me:

delay 5
--tell application "System Events" to get properties of every process
tell application (path to frontmost application as text)
	activate
	display dialog (path to frontmost application as text)
end tell

Perhaps, if you just want to show some info, you could try growl, perhaps you can sent growl notifications via AppleScript

cirno:

It’s not clear what your needs are, but simply telling your script to display the dialog instead of a target app works reliably.


tell me to activate
display dialog "foo"

Peter B.