Display Dialog

Is there a way to make a display dialog be always-on-top? Is it also possible to change the position that a dialog is opened?

Thanks :smiley:

I don’t know how you can set the position of the dialog box but this is how you display it on the top:

tell application "SystemUIServer"
	activate
	display dialog "OK"
end tell

I don’t think there’s any way to keep a dialog on top, if that’s what you mean.

Otherwise, the ‘display dialog’ command can be directed at a particular application. Besides mindtpi’s suggestion, you could bring the script itself (ie. the application running it) to the front:

tell me
	activate
	display dialog "Hello"
end tell

But if you know the script’s targetting the frontmost application, you may prefer to keep that application frontmost and tell it to display the dialog. More generally, you can tell whatever happens to be frontmost at the time to display it:

tell application (path to frontmost application as Unicode text)
	display dialog "Hello"
end tell

If you want a floating dialog that stays above all other windows, the only solution I know of is to use 24U’s Appearance OSAX. It works extremely well and is fairly simple to use.

Thanks everyone for the input. I’ll probably be looking into Appearance OSAX. :wink:

Using the ‘display dialog’ command leaves much to be desired with respect to what you’re trying to do. Personally, I prefer not to use any osax other than those that come with the OS, as you can get most of the features of 3rd-party osax by other means.

Have you considered creating a small project in applescript studio (xcode)? You can set the level and the position of a custom window quite easily when working with ASS projects. The features of a dialog are pretty straightforward to reproduce in ASS, and are fully configurable.

j