Is it possible to have the parent run a script or have an object refresh when a card window is closed?
That should work and the variable need not be global.
Set Variable [$SelectedValue ; value: Table::Field ]
Enter Find Mode [pause:off]
Set Field [ Table::Field ; $SelectedValue ]Perform Find 
not really. what would you like to do exactly ?
How about using a button with single step "Resume script" instead of closing box of card window?
Card window can be opened via only script, so do all in a script
New Window[card]//do somethingRefresh Object
will do it, but OP maybe not want script pausing while //do something.
The OP describes a solution to his problem without describing the problem. It's hard in my opinion to provide an answer without knowing the problem.
Refresh an object on which window?
Closing a card window trips the OnWindowClose trigger like any other window closure. Such a script can use Get ( WindowName ) to possibly determine that a specific card window has now closed and could then act on the parent window possibly?
The only way for a window to "know" its parent would be to remember the name of the window that was current when the new window was opened. Not as easy to do as it sounds in a multi-window environment (and all FMP solutions should be assumed they will operate with multiple windows IMHO). This would be almost impossible if window names are not unique -- how many developers just open new windows and name them "Report" or "Preview"?
Having said all that, script the closing of the window and issue commit record and refresh window steps. This will refresh whatever window is now in focus, which is probably good enough.
I checked it, but there is no information about parent/child, so user(developer) need to manage window names himself. And the trigger fires before close, so after closing card window no trigger fires.
But this is a card window. Doesn’t the parent window automatically become the current window when the card window closes?
Yes, if user click close button. (Scripted closing doesn't, but this may not be OP's case)
I'm not sure what type of the "object" should be refreshed, and it can be done while card window remain in front of parent (onWindowClose trigger script). But it worth to try.
Thanks to all for replies. I have been down sick for a few days and could not see the questions. What I want to do seems simple enough. Here is what I'm trying to do:
1. I want to pull up a list of custom choices in a card (child) window. (different context than parent)
2. Have the users select one of the choices.
3. Store that choice in a global variable
4. Close the child card window
5. Filter the parent window based on the global variable
I was wondering if a script called by the child could
1. close the child card window
2. then perform the find on the parent (if the parent is now active window)
If there is another way I am open to options. I'm still a bit of a novice at FM.
Thank you! That makes perfect sense!
Retrieving data ...