Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

dynamically calling a script in a file

Featured Replies

hi,

at the moment we are using eventscript to call a script in a file.

this works really well, except when we want to run a number of script steps after the called script has completed - filemaker moves on before the called script has completed.

this is pretty much it:

set variable "abc" S4HU_EventScript ( $_CurrentFile; $_ScriptName )

set field...

set field...

set field...

so, it will execute the script identified in $_ScriptName, in the file identified in $_CurrentFile, but FileMaker will move onto the Set Fields before it has finished executing the steps in the Script.

is there a different way of using EventScript so that it completes the called script before moving onto the next script step?

or, is there another plugin that we can use which will call a given script in a given file?

tia,

jd.

You could have the script that EventScript calls call back to a local script to do the Set Fields. It's an interesting question. I wonder if a Commit Records step just afterwards would pass control to the EventScript script and solve the problem? I don't know how that affects a Variable however; maybe it needs to be a global field than triggers it instead?

Hm, an interesting idea - using a plugin to select a sub-script by calculation. I don't think it can work your way, though. The main script has no reason to stop, since all it's doing is setting a variable. Meanwhile the plugin has placed another script in the stack - but since the current script is not paused, the execution order is unaffected.

However, it gives me a rather crazy idea. Suppose the main script were somehow paused, you could then run your sub-script and have it resume the main script when it's done. You would need to use a plugin that has a "control" parameter, such as DoScript or zippScript, but I think it could work.

(testing...)

I have posted a demo file that shows how it can be done here:

http://fmforums.com/forum/showtopic.php?tid/192021/

The problem since FileMaker 8 (not 7 I think) is that a plug-in triggered script is put ta the bottom of the stack, unlike a standard Perform script action.

The control options of DoScript and zippScript is not a work around :

You'll have to split you main script.

I wonder if this is not an issue that would explain why FMI still did not implement script triggerring in its products.

The demo I have posted shows 0 downloads at this time.

Wow !

Comment, you did it !

Very, very neat. Been trying to solve this for months. Awesome !

  • Author

hello,

thank you so much - this looks very much like it will do the trick.

we are going to try this out in our file ASAP and will post the results.

jd.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.