It works fine for me.
Perhaps more detail with exactly what you're doing might provide insight. Maybe a sample file. OS? Device?
The script step...
Adjust Window [ decision ] ...(decision = Resize to Fit, Maximize, Minimize, Restore, Hide )
Have never had an issue with this on both platforms...
Thanks for responding Mike!
I am working on a PC running MS Win 7 and FM Pro 12 Adv.
The environment is as simple as I can make it.
It consist of;
1 File (Test_Window), 2 Tables (Tbl_1 / Tbl_2), each Table having 3 fields each, (ie, f1, f2, f3 / f4, f5, f6)
The file name is Test_Windows, thus the first window opens with the name of Test_Widow, I then select a New Window from the menu and the second window comes as Test_Window - 2.
With 2 windows open each containing a layout for each table, I opened a new script naming it Test_Hide_Restore;
*Go to Layout ["Test_Window - 2"] // I verified it by using Get(WindowName)
*Adjust Window [Hide]
*Pause/Resume Script [Indefinitely]
*Adjust Window [Restore]
That's it, nothing else. When the script runs both windows simply sit there waiting at the Pause.
However, with both windows open when I select from the Menu -> Windows -> Hide Window the top window disappears. I can then recall it from the same menu using Windows -> Show Window.
Again, "Thanks for your time".
Perhaps I am not understanding the functionality of the script command.
Thanks for responding Tim!
Please see my detailed response to Mike.
I am clueless...lol... Just don't know what to say...
1 of 1 people found this helpful
Your script can't know which window to restore. You might be best to put your window name into a variable which is used in the restore.
You should also name your windows...
Sent from my iPad
11th Hour Group Pty Ltd
The first line of your script is wrong: *Go to Layout ["Test_Window - 2"] // I verified it by using Get(WindowName)
"Test_Window – 2" is the window name, not a layout name. You need to use Select Window instead. Also, in your script, because the script has not led to a change of window context the Pause step causes the window, having just been hidden, to be immediately reactivated thus appearing as if nothing has happened. (When you do this manually FM switches focus to whichever other window happens to be next in its stack, but when scripting you have to tellit to switch to a new window, otherwise it keeps the existing window in focus, even if it is hidden—at least, I think that is what is going on!)
The following script fixes both these issues and will achieve what you are trying:
Select Window [ Name: "Test_Window – 2"; Current file ]
Pause/Resume Script [ Indefinitely ]
Adjust Window [ Hide ]
Select Window [ Name: "Test_Window"; Current file ]
Pause/Resume Script [ Indefinitely ]
Adjust Window [ Restore ]
Well keywords, you are the "key!"
Good catch on the typing error... I don't know where that came from...
BUT, more importantly, you are absolutely correct. Interesting how the Pause step forces the window to remain active.
Once that came out of the script and I used the "Select Window" in conjunction with the Adjust Window [action] everything functioned as advertised.
Btw- I used the function Get (WindowName) within the Select Window  and it worked as well.
Thanks again keywords!
Thanks to all as well!
Excellent idea on naming the windows.
You are welcome Tom. Just one additional point. You say: Btw- I used the function Get (WindowName) within the Select Window  and it worked as well.
That function will work on the first step as long as you activate the script from within the window you wish to hide, because Get ( WindowName ) will return the currently active window.