What exactly to you mean by "running a request"?
You can use new window to open a small window that displays a message. If you have filemaker 12, you can even disable controls on this window and/or make it modal if you want. Similar results with scripting can be done in FileMaker 11.
But the key will be able to detect the completion of the original task so as to close the window when you are done. There are several approaches that may work, depending on what you mean by that first statement.
Let's see if I can clarify this better...
I have a tab where I enter my search criteria (to search an external web service which is actually performed through a c# application using filemaker xml export/import records). Once I press a button to start the search, I want to display a popup message indicating that the request is currently being processed at least, until the point where the results get returned and imported into my application.
I'm not sure if your script that does this will initiate the import process and immediately proceed to the next script step or wait until the import process is complete. If it waits, you can make an early step in your script, the new window step that displays the message and the final step of your script a step that closes the extra window.
So if I understand correctly, I can upon a new window, give it a window name, then go to the layout that would display the informational message. I see I can use the Select Window to toggle back to my main window, but am not sure what's the correct syntax to do so since I'm not sure how I give my main window a name or something to that effect. I'm not sure if this new window will always stay on top focus even though I need to access other layouts for lookup purposes and such as well.
Which version of filemaker are you using? There are scripted methods to keep new windows in pre version 12 files "modal" (kept in front) and there's a poperty setting you can use in version 12 to do the same thing more simply.
Your original window will have the same name as your file's name unless you use a script to specifically rename it. Thus, you can probably use Get ( filename ) to refer to your original window by name.
When you say "I need to access other layouts". Will this be your script needing to change layouts or the user? If the script, then no problem, you can use the select window step to return focus to the original window, freeze the window (if you don't want layout changes to be visible to the user) and have your script do what's needed to look up data, etc.
I'm using FileMaker Pro Advanced 11, and while I can seem to switch back to my main window now, and the new window appears on top, the one thing I noticed was my new window somehow has now has the same layout as my main window. Here's a snippet of my script when I setup the new window:
Set Field[Search::OutTag: "X"] // indicates processing has begun
New Window [Name: "SearchMsg"; (still working on correct dimensions here)]
Select Window [Name: "SearchMsg"; Current file]
Go to Layout ["SearchMsg" (Search)] // blank layout containing message mergefield.
Select Window [Name: "HCDSearch"; Current file] // main window of HCDSearch.fp7
Go to Layout ["ini_setup" (ini)] // another layout where I store settings
Immediately after opening a new window, use go to layout to specify the layout you want for your new window.
In cases where specify dialog won't serve, I've set up a layout with either a global field (filemaker 10) or a global variable (Filemaker 11) placed as merge text in the upper left corner of a blank layout with vertical and horizontal centering. I use Set Field or Set Variable to put my message text into the field/variable and specify dimensions for the window that "stretch" it out to a size larger enough to properly display the desired message. This allows me to use one layout for multiple messages.
Hmmm, I tried disabling the "Select Window [Name: "SearchMsg"; Current file]" line to make it immediately go to desired layout on new window, but it seems to ignore my "Select Window [Name: "HCDSearch"; Current file] line when I'm in my script debugger, so I'm not sure what I really need to do to switch back to my main window while leaving my new window with the appropriate message.
New Window [specify size, location, name, etc of new window here]
Go to Layout [specify layout for new window here]
Select Window [get (fileName) ] //return focus to original window if it is named the same as your file's name(the default).
#after doing what you need with the original window:
Close Window ["name of message window here in quotes"]
Should do the trick.
It turned out my main window already had a title of "HCD COLLECT" so at least that worked. Only problem was once my main window re-gained focus my popup window seemed to either disappear or appeared behind my main form.
If I need to wait for filemaker 12 then I have no problem with that.
Hmmm, yes it would. But maybe you can do it all with the focus on the "message" window and not need to return control to the background window.
Here's what I have in mind:
After opening the message window and changing layouts to the correct layout,
Go to Layout [
with the focus on the message window, but with it "frozen" so that the user doesn't see the layout changes.
This will work in most cases, but I can think of situations where the change in window will create a few challenges...
One other thing I just thought of is having yet another new window which I believe I can hide and still do other lookups with behind-the-scene layouts, so hopefully that will work.
The "Freeze Layout" seemed like a nice idea though unfortunately it changed when I went to another layout unless there's a parameter I may be missing.
Freeze Window will do the trick but it freezes a window, not a layout. If you make changes in a different window, those changes will show. What I am suggesting is to do it all in the small pop up message window and do not return the focus to the original window until you close the message window.