General Question

lefteh's avatar

How can I force a dialog to open in the front in AppleScript?

Asked by lefteh (9429points) June 18th, 2008

I just can’t seem to force my dialog to open in front of Firefox.
Here‘s the code.

Observing members: 0 Composing members: 0

4 Answers

robmandu's avatar

Each window on the Mac belongs to an application. Probably the easiest way to raise the alert window is to raise the application posting it. There is AppleScript verbiage to do this, something like:

tell application “Xyz” to activate

If the dialog is posted by an AppleScript ‘display dialog’ command, then the dialog is owned by the app named by the innermost ‘tell’ block containing the display dialog statement.

from an Apple discussion

I didn’t see any “activate” mentioned in your code snippet, so I hope that helps.

lefteh's avatar

Robmandu: Your suggestion, even though it didn’t work quite right, led me to a solution that worked.
Thanks!

jrpowell's avatar

@lefteh
Would you mind sharing what worked? I’m curious and it might help someone that stumbles upon this page from Google.

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther