Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7726 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

If you exit a script via the "Exit Script" step, FM show up the file the script belongs to, even if the window was hidden.

For example:

Toggle Window[Hide]

Exit Script

the window comes out.

Halt script does the same.

Just wondering if it is a bug or a feature...

BTW: it is annoying for me because I often call external script on "data only" databases from the "interface file". If the ext. script exits via Exit Script, the "data only" file comes out.

Posted

When you run scripts that call external scripts, make sure that the script does not end in that external file, otherwise as you have found out that database will come to the foreground.

Instead, place your exit script in the database that you wish to end in, which in your case would be your interface file.

So, from your interface file

#Your script here

Perform Script [External, data.fp5, "Your external script"]

Exit Script

In your external script the last step is Toggle Window [hide]

HTH

Posted

I have in all databases script DUMMY, which is called from any other file if I want to transfer focus to file. It is ending with HALT so it stays on that file.

Posted

So the answer is "Yes. We have noticed!"

I think it's bad. I have to exit each ext. script from the end instead of anywhere. This means a lot of nested IFs...

Posted

I don't get it.

If you start script in file A and then you call script in B where everything stops, why it shouldn't show the file, where it was stopped?

If you use Exit in file B and then calling script in file A will have more script steps, then file B will stay behind.

IMHO it's quite logical.

Posted

It's logical for Halt Script. Because stops the script execution.

It's less logical for Exit Script. Because execution goes back to the calling script. But it's just an opinion...

Posted

Off course no.

But control [should] go back to calling script even if there are no more script steps to execute.

In fact FM documentation says about exit script step:

"Forces sub-scripts or external scripts to stop immediately and return to main script.

"

"RETURN TO MAIN SCRIPT"

But I repeat, it's just an opinion.

...and it doesn't matter that much, since we can't change things smile.gif

Posted

yes...but if there are no other lines of the script AFTER you perform the external script the only place it can go is to stop with that database being the last one accessed by ANYthing FileMaker related.

This of course makes that database come to the front.

Posted

Paolo, I understand what you are saying and see the problem. But you are right, you just have to work around this bug ... ooops super nice feature. We KNOW FM doesn't have any bugs.

I think what you are saying tho is lost here. What the problem is is that you want the db with the external script to stay HIDDEN. That doesn't happen even tho the documentation says it should.

And yes, it will take a bunch more "if" statements to handle this problem.

For everyone else, let me give you an example. Say I have a script that needs to pull data from an external db after doing a find on that db. So I execute the external db script and either the data is found or it isn't. If it is, I want to continue with say an export or maybe the calling db takes it and manipulates it. BUT if there is no data returned, I just want it to stop and wait to be called again. LOGICALLY I should be able to just EXIT the script and the calling db takes control again. The documentation says this will happen. But it doesn't. Instead the db with the external script in it pops up to full screen, which I don't want because it now has control.

So the solution is to add in an "IF" statement so that IF nothing is returned THEN something is done on the calling db so control returns to it.

Posted

No need for heaps of nested Ifs, just put a something at the end of the calling script. A Refresh Window [] step wotks well as does Exit Script. But the main script needs something else to process after the external script.

This topic is 7726 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.