October 29, 200124 yr Newbies Hi I am just learning filemaker pro ver 5. I am tyring to create a button that performs the following task 1.enter find mode 2.auto enter some text into a specified field 3 perform the search I have been playing around with the scriptmaker, I can do 1 and select the field but cant enter the text. I have been playing wiht the "insert Text option" but I cant get it to work. Help!
October 30, 200124 yr If it's always the same text in the same field, perform the search, then create a script to: PerformFind[Restore, No dialog]. This will perform the last find you did.
November 1, 200124 yr >>>PerformFind[Restore, No dialog]. This will perform the last find >>>you did. Which "last find" will the script perform? The last find performed before the script was last altered? The last find before the script is called up? I had to create a series of scripts, each finding records belonging to 1 of 6 different categories. Before I created each one I manually performed the find and told the script to "restore without dialogue" that request. Then I "replaced" the find request when the final dialogue box asked if I wanted to keep or replace. Was I correct in "restoring"? Was I correct in "replacing"?
November 2, 200124 yr You want the "Modify Last Find" script step to recall the last find performed. Note that if there is no last find it'll break, so you need to trap for it: Set Error capture [on] Modify Last Find If [ Status(CurrentError) <> 0 ] Enter Find Mode [] End If
November 2, 200124 yr Sounds right to me. The last find performed means just that, regardless of whether it was done by a script or manually. Opening a script, closing the script, and selecting "replace" will capture the last find for a Perform Find(restore) script step. Remember that only one find definition can be saved per script, even if you have multiple find statements. As a matter of programming technique, I never use Perform Find (restore). It is not self documenting. The only way to determine the find being performed is to 1) perform it and do a refind on an "All Field" layout or 2) print the script. I exclusively use: Enter Find Mode () Set Field (field1, value) Set Field (field2, value) . . . Perform Find () or some variation. Use Set Field, where possible as it doesn't require the field be visible on the current layout. The "Insert Text" script step fails when the field inserted to isn't on the current layout. -bd
Create an account or sign in to comment