hartmut Posted September 30, 2013 Posted September 30, 2013 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
No_access Posted September 30, 2013 Posted September 30, 2013 You need a plugin to run a script from a calculation, you can look at http://www.softs4humans.com/FMPro_Plugins.html as a starting point.
eos Posted September 30, 2013 Posted September 30, 2013 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… 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now