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.
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.