Database Reference
In-Depth Information
"--- " & Get(CurrentDate) & " @ " & Get(CurrentTime) & " by " &
Get(AccountName) & " ---¶"
You can use any method you want to enter the calculation, as long as your calculation
looks like this one when you're done. See Trigonometric Functions to learn about
Get() functions.
13. Save the script .
Your new script is ready to test.
Now you just need to add a button near the Notes field that runs your new script. When you
click the button, FileMaker adds the separator to the field and puts the insertion point in
place. Your notes will be nicely organized and separated.
WORKAROUND WORKSHOP: FEWER STEPS, BIGGER CALCULATIONS
You can easily create the Add Note Separator script described on Building the Script , but it has
one weakness: It uses four steps where two could accomplish the same thing. A more concise ap-
proach would be to put the separator and a few blank lines at the top of the Notes field first and then
use the “¶” to put the insertion point after the separator. The drawback here is that you have more
complex calculations to write. The choice is yours. Here's how.
In the Insert Calculated Results step, you need a calculation that builds the separator line, adds
two blank lines after it, and finally adds the old contents of the Notes field to the end:
"--- " & Get(CurrentDate) & " @ " &
Get(CurrentTime) & " by " &
Get(AccountName)
& " ---¶¶¶" & Customers::Notess
To keep the contents of your field from being duplicated, make sure you leave the “Select entire
contents” option on this time.
Now you need to get the insertion point in place after the first line, using the Set Selection script
step. Use the same technique as before: Set the selection with an end position that's smaller than the
start position. FileMaker puts the insertion point before the character at the start position. Since you
want it after the end of the first line, you need to find the first new line symbol, add 1 to it, and put
that in the Start Position field. Here's the calculation that does the trick:
Position ( Customers::Notes; "¶"; 1; 1 )
+ 1
Put this same calculation, but without the last +1, into the End Position field. Delete the extra script
steps, and you're ready to test your script.
Search WWH ::




Custom Search