You could position the window off the screen, in which case you don't need the Hide Window step, since it will not be visible anyhow.
As you can see in my code example, I previously had it that way. But users
'scroll' (in windows) to where it is and then are'confused' by it's
presence ... go figure...
The question is 'how do i make the window 'hidden'? And 'why doesnt the
code work in this script but does work in a different script?? ?????
During debugging, the window won't hide, as you're seeing. Try it with debugger off, and it should work properly, hiding the window as you intend.
It doesn't make any difference whether I have debug on or off. The (*&@(2 window will NOT 'hide'....grrrr
But if I run just steps 9 and 11 in it's own script it works. Could the IF statement be the problem?
Here is a better, pictorial representation of what is going on.
I can run this in debug (shown above) and see that the Hide step is being executed. Yet, running it out of Debug has the same result.
I searched for additional information on Hide but FM doesn't provide much.
I hope this clears things up...
yes the if may fail, but could the Select Window may also fail ? One easy way to know if the script execute the if body, is to add the script step beep. You may add one after line 9 and 11, so if you hear 2 beeps, you are (almost) sure both steps execute.
What OS are you running on and which version of FileMaker ?
Hum, I am wondering if something else could fight with your script, like a script trigger or a timer on the window you wish to hide ?!?
Got your last post once I send mine . So you're getting into the if body. So a script trigger / timer may be what you should look at. In either case, the debugger would show, if it's not a PSOS I guess.
I tried using beep and it confirms that the step is being executed.
There are no script triggers on the layout
I never set a timer on the window.
What is a PSOS?
It bothers me that the same script without the IF works ok.... Why?
What about trying a slightly different method?
At the beginning of your script, add:
Set Error Capture [ On ]
Instead of the If, use:
Select Window [ Name: "Reset Lodge Setup" ; Current File ]
If [ Get ( LastError ) = 0 ] //The window was selected if there was no error
Adjust Window [ Hide ]
Perform Script [ "Reset Lodge Setup 77 New" ]
Sounds like a good idea. I will try it. If it works it sounds like a Filemaker BUG.
For now: I created a 2 line script called JunkerWindow
If I run this script it 'hides' the window.
However, when, I substituted in the original script, running the JunkerWindow script above:
This caused the original, 'Will not HIDE" window failure.
What is That about? A Filemaker bug?
I am running:
Filemaker 15 Advanced 22.214.171.124
By the way...does the Adjust Window [Hide] step give you an error? Or does it just refuse to hide the window?
Yes, could be a bug. Can you try on Windows 7 ?
Before calling JUNKERWINDOW, you already select the window. I wonder if disabling line 9 would give the same result.
One other thing you may try is adding a delay between selecting the window and hiding it. If that works, then you have a workaround. Hope someone from FMC will chime in.
That is a great idea.
it seems to me if it is a bug FM would have a *LOT* of posts on the problem; they don't.
But, I use the same If structure elsewhere without a problem. Perplexing
Would the problem be that you hide the window that's currently active -- so it unhides? If you hide the window, what window do you want to become the active window?
I'd suggest trying:
change to another window
hide the first window
To hide the first window I have to specify it with a Select statement; right?
Line 9 selects the Reset window
Line 11 Hides it
How would I change to another window (Membership) and hide the Reset window? I am missing what you mean.