6 Replies Latest reply on Mar 29, 2012 8:24 AM by taylorsharpe

    Random Text


      I would like to display a random text upon layout entry or daily,

      Is that possible?

        • 1. Re: Random Text

          A random text can be quotes or something you store in a table then you just randomly pick a record to show (based on a random number) when entering the layout.


          Is that what you had in mind?


          agnes b. riley . filemaker and web development


          T 201-299-6223 (NJ) . 212-842-8830 (NY) . 917-660-7221 (C)

          FileMaker Certified in 10 and 11

          1 of 1 people found this helpful
          • 2. Re: Random Text

            I assume by random text, you have something say a phrase of the day and you have a list of phrases.  They can either be stored as an array in the script or probably better as a field in a table so that it is easy to add, modify or delete these phrases. 


            What you do on your script is go to the phrases table, show all, and do a record count to find out how many records you have.  Then use the Random function (gives a number between 0 and 1) multiplied times the number of phrases and truncate the decimal.  This will give you a randomly selected number corresponding to a record with a phrase in it and each time you run the script, it will randomly select a new phrase. 


            Is that what you mean and do you understand my explanation?  If not, I can show each script step if that would help. 

            • 3. Re: Random Text

              That's it exactly. I'll give it a try.



              • 4. Re: Random Text



                yes that's what I mean..

                • 5. Re: Random Text

                  Random * 100


                  So how do I run this daily or onobjectenter?

                  • 6. Re: Random Text

                    You can use the ScriptTrigger for when you load the layout so that every time you go to that layout, it would run this random script.  I also always have a startup script that I do various things when someone opens a file and this would be an example of something I might do in the startup script too. 

                    1 of 1 people found this helpful