What should I do to remove red close button on the top right corner of windows?
Why do you need to remove (or disable) that button ? There could be better ways to handle your needs.
You can open new windows in FIleMaker with a script step, "New Window". While defining the attributes of the new window choose to turn OFF the "Close" option in the Window definition dialog. The window as opened will not now have the usual red close button when the script step opens the window.
However, make sure you have a scripted-button in the layout that will allow your users to "Close Window". The scripted-button is especially important if you open a "Dialog" Window (a.k.a. a "modal" window), because with the red close option absent from the Dialog window, it will take over your computer and your user (or you) will have to force FileMaker to quit to get control back.
More about the "New Window" step in FM HERE.
When I use the new windows script step it opens 2 different windows and exit software script step is not working
Your script appears to be the one triggered by event "OnFirstWindowOpen", or in other words, your startup script.
The very first thing FileMaker does while opening a file is open a window - which then triggers the execution of your startup script. Per your logic above, the script is then opening a second window when it hits line 4 of your script. If you don't want the very first window, at least in the case where Get( AccountName ) ≠ "Admin", do a Close Window before reaching the New Window step.
Did you mean it isn't doing the "Exit Script" step? Do you have a way to dismiss the Dialog window?
I love Monkeybread Software - MBS FileMaker Plugin: Window.SetCloseButton
when people call and whine because there is no close button, I can ask them why they don't hit the 20x bigger close button we provide, which does a lot more things we need to be done on some specific close window.
Retrieving data ...