Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

Hi

I have a bunch of premade scripts that format completely different styles of text in a merge field. 

I am asking how to make a calculation to execute a random script from the group.

 

Something like

 

Random  (Script1, Script2, Script3)

 

 

So it will play a random script each time..

Thanks for your help

Dave

Posted

1. Check what these sub-scripts do. If each uses the same functions, only with a different set of parameters each time, then use a single script and randomize the (choice of) function arguments.

 

2. If there aren't too many scripts involved, you could use branching like this, e.g. for n sub-scripts:

 

Set Variable [ $rand ; Int ( ( Random ) * n ) + 1 ]

If [ $rand = 1 ]

Perform Script [ Script 1 ]

# …

Else If [ $rand = n ]

Perform Script [ Script n ]

End If

 

Might get a bit tedious for a reasonably large n

  • Like 1

This topic is 4129 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.