I’m guessing it stops if the closed window is the last visible window in the database running the procedure, I have not confirmed this. In my case, closewindow is closing a second open window in the same database, leaving the database still open to complete the procedure.
Actually the procedure will continue to run even if the database that contains it closes. The Procedure will run to conclusion unless there is an error or Panorama X itself quits. I just confirmed this with this code on a test database:
Sure enough, 10 seconds after closing the file the message popped up.
I actually think this is working exactly as intended. The documentation says:
This statement closes the currently active window.
When Panorama is not the frontmost application, there is no currently active window. Only the frontmost application can have a currently active window. I’m sure you were thinking whatever the frontmost Panorama window was was the active window, but that’s not the case.
Yes, that won’t help because it only works within Panorama, it can’t affect the fact that Panorama is not the frontmost application.
You may want to use info(“panoramaisactive”) to check if Panorama is active. That way you could give a different error, or you could use bringpanoramaforward.
I’m glad to hear it. But I’m also puzzled, because I would have assumed that the bringpanoramaforward statement uses the same API that AppleScript uses when you activate. Perhaps I’m not correct about that assumption.
I got a CloseWindow error when I left Panorama X before the last two lines executed but the procedure window was brought forward so the bringpanoramaforward statement evidently executed ok. Also got the error when I substituted the AppleScript in the above code. If I add the second openform statement before the closewindow statement I do not get a error using either th AppleScript or the bringpanoramaforward method.