zymondee Posted October 26, 2006 Posted October 26, 2006 How can I prevent FileMaker Adv 8.5 to perform a start script to run when I open a new window? In my solution I have a start script which is set to run upon opening the database (set in "File options..." When the database is opened and it is no need to run the start script again but I have noticed that when opening a new window the start script is trigged to run again. Why is that? When stepping forward in the script (using the debug) I can clearly see that when opening a "new window" the debug jump directly to the start up script and starts to step forward in that script in stead. Is it possible that the command "New window" can trig the start script to run if it is selected in "File options..."? Has it something to do with the menu which is customized to a minimum of commands that confuses FileMaker? I have a minimal menu with no windows to select and almost no commands. Could the reason be that the database start script trig as if it was opened again if some of the menu alternative is taken away? No other script is running at the same time, it is only this script which opens a new window. Maybe there is an easy explanation if it is possible to trig FileMaker as if it was opened again in some way I dont know. Feature or bug? Unfortunately my solution is very complex and I have not had the time to rebuild this behaviour with a lighter example to publish here. At this time my solution is to open "this database" file from "another database" file which calls the start up script directly in "this database" instead of just open it and use the "File options.." preference. Best regards Simon Danielsson FM-developer since -89 Adsensia Sweden
ThatOneGuy Posted October 26, 2006 Posted October 26, 2006 Hi Simon: My money is on Custom Menus. Sounds like the author (couldn't tell from your post if you're the developer) may have customized the New Window command to run the same script used as the start-up.... just a guess. :twocents:
zymondee Posted October 27, 2006 Author Posted October 27, 2006 Good idea! Today I did some tests! I checked all my customized (yes I am the developer)menues if they were attached to scripts that might trigger the start script to run but unfortunately I coulnd find anything. The very strange thing about this is that it is happening the first run when I click a button to open this window. It is a script which open a new window which the first time it is run it also runs the startscript when it comes to the script step "new window" BUT ...the second time I run this script it will not run the start script. So, still it is very strange. What is triggering? Is it some variable which is not set the first time so it trigger the start script was my first thought. But I cant find any. So, I will probably go for my workaround not to use the option to run a start script upon opening the database file. Cheers SD
zymondee Posted October 27, 2006 Author Posted October 27, 2006 OK! Listen to this! This is interesting and important information that I would like to have response to. I stripped the script down to contain only the "new window" step and got the same problem. Well, I think I have found it now. If I open the main file directly by clicking on the file and then let the start script run (set in file options) I dont have the problem I mention. But, if I use my "start-up file" the problem occurs! So, what does the "start-up file" do? Hehe..of course it recalls the start-up script in my mainfile where I have the problem. So, my concl is that I cant use the "file option" utility as long as I recall the same script with my start-up file. I am pretty sure that the FileMaker application "stores" somewhere that one of the start-ups have not run yet. So, what triggers this sleeping event to happen? Yes, it is when I open the new window. I know....I should report this to FileMaker and well, I did yesterday in my bad English..so maybe I will try and give it a more understanding version. Happy weekend everyone! Cheers /SimonD
ThatOneGuy Posted October 27, 2006 Posted October 27, 2006 Hey Simon: Sounds like you've narrowed it down a bit. That's good, and your last two posts triggered something for me. Don't know if it's the source of the problem, but it may be involved. When you do a "fresh launch" of your StartUp file, does "FileB" appear under the Window ... Show Window submenu, perhaps within parentheses? If so, this indicates that the StartUp file has a relationship to FileB. FileB is not being opened, so much as it is being prepped to open. Thus, the startup script for FileB is not triggered. Subsequently, when you click the button in your StartUp file, the startup script in FileB is being executed for the first time. If I've gotten lucky with my guess, it may only take a little restructuring of your launch scheme. You could ... • edit the startup script in your Startup file by adding an Open File script step to open FileB, • followed by an Adjust Window script step with Specify set to Hide. This would fully open FileB, then hide its window. Later when you click the button on your Startup layout, the hidden window of FileB will be displayed. ... I think. As for reporting it to FileMaker, I don't think it qualifiies as a bug. Let us know how it goes!
Recommended Posts
This topic is 6604 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now