I would like to display a random text upon layout entry or daily,
Is that possible?
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.
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
That's it exactly. I'll give it a try.
yes that's what I mean..
Random * 100
So how do I run this daily or onobjectenter?
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.
Retrieving data ...