Jump to content

Get Out of Script By Running a New Script?


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

Recommended Posts

Anyone know if there's a way to automatically cancel a running script by initiating another script?

Example: I have a Find script that takes users to a new layout. While there, I want them to have the option to cancel their find. So I created a button labeled "Cancel and Return to Tracker." That button runs a little script that takes the user back to the main layout and switches back to Browse Mode.

The trouble is, once that little Return script is finished, the user is still hanging in the original Find Script. What's the best way to tell filemaker that running the Return script should cancel the current Find script?

Or perhaps I'm approaching this all wrong and there's a better way altogether.

As always, thanks in advance for any advice!

Link to comment
Share on other sites

Even though you figured it out. someone else might learn from this post.

There is a Current Script option when you attach a script to a button. When you select Perform Script, you'll see an option right next to it allowing you to Halt, Exit, Pause or Resume. You usually want to leave it at the default of Pause but in the case you describe, I usually change it to Halt. Exit will likely work the same but it will only exit the current script and may return to a calling script. Best to be safe and use Halt if you want no scripts running when you click your Cancel Find button. Resume will continue the script that is paused in the background but only after the newly initiated script is run. This is true for all of the other Current Script options. The script attached to the button runs first and the script paused in the background is either Halted, Exited, Resume or Paused. This doesn't usually make a difference but could in some scenarios.

Link to comment
Share on other sites

This topic is 5688 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
 Share

×
×
  • Create New...

Important Information

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