How to move a message box in front of a web page?

I have a procedure which opens a web page and then puts up a message for the user. Problem is, the message box is hiding behind the web page. How do I bring it to the front?

A web page in Safari? In a Panorama form? What does “message box” mean? An alert?

I suppose the most likely scenario is that you’ve opened a web page with Safari, then displayed a message using the message statement. But since Panorama is now in the background, the message alert is hidden by the Safari window. If you wan’t the message alert to appear above the Safari window, I don’t think that’s possible. You could use an AppleScript to get Panorama back to the front, but then the Safari window would be hidden. (By the way, the next version of Panorama X will include a statement that makes Panorama X the frontmost application, so an AppleScript isn’t needed for that. But that still won’t solve your problem of displaying a message in front of another application.)

When you use the message statement, notice that the alert displays a Panorama icon. That’s because it is part of Panorama. So when another application comes to the front, all of Panorama’s windows are hidden behind the new frontmost application. This includes Panorama’s dialogs and alerts.


Maybe you could display an alert using AppleScript? I think an alert created by AppleScript does not belong to any particular application, so it would appear above everything else. But I’m not 100% sure about that, nor do I have the syntax for an AppleScript alert at my fingertips.

If the web page is one you control, you could use JavaScript to display an alert. I’m guessing you don’t control the web page, though.

Sorry - insufficient info again. ‘Message box’ meant the message alert - I’m doing a lot of Excel macro work at the same time and MsgBox is the VBA command for an alert.

The web page is opened in Safari with an openurl statement in Panorama X and I want the user to put some input into the page to create a text file which Panorama X will import.

I can tell the user to pre-position the Safari window off to one side, allowing some or all of the Panorama X alert to be visible. Ideally, I’d like to control the location of the alert on the screen but I don’t see an option for that. As you say, I can always fall back on AppleScript as a last resort.

This sounds like it might be a good candidate for using a Panorama form with a web browser object, rather than using Safari. Then you could display the web page right in Panorama. You could either include the instructions in the form itself, perhaps above the web browser, or use a message statement.

I’ve never used a web browser object but let’s live dangerously.

For an application like this all you need to do is take the formula that you created for the openurl statement and put that into the Formula panel of the Web Browser Object. Shouldn’t take more than a couple of minutes (maybe you’re finished already!). This object uses the same WebKit engine that Safari uses, but embedded into a Panorama form!

What is the name of the new statement that will place the focus on panorama after an openurl statement? What version are we talking about? Quote “By the way, the next version of Panorama X will include a statement that makes Panorama X the frontmost application”

The next version will be version 10.2. The current version is 10.1.2. The new statement he referred to is apparently BringPanoramaForward. It won’t be available until version 10.2 is released.

1 Like

Thanks. I have a clock program that makes sounds. I open mp3 files and a sound is played. I then quickly have to click on a panorama window so the next sound can be played. It would be nice to open in the background or make pan the fore ground with a command.

I haven’t tried it, but it sounds like the afplay shell command will do what you want.

You can invoke shell commands from Panorama X using the shellscript statement or shellscript( function.

If it works, let us know.