Fenton,

I didn't make it clear that I am still using FMPro 6.0v4. Some of the FM script steps that you define are ones I don't recognize.

Will something like you listed work with FM6?

Thanks,
Charlie

You'd do this within a Perform AppleScript step.
First you'd set the FileMaker field (cell) data into an AppleScript variable.

Then use a simple command line command to read it, echo. By default it adds a new line character at the end; but this can be suppressed with the -n option. To append to a file you use the redirect symbol, >>

Assuming the field is named Text_, you can create and append to a file on your Desktop named Test.txt (the tilde ~ is short for your Home folder, which is where your Desktop is):

set theLine to cell "Text_" of current record
do shell script "echo " & theLine & " >> ~/Desktop/Test.txt"

If you do not want the last line to have an extra return, you could suppress it this way:

set theLine to cell "Text_" of current record
do shell script "echo -n " & theLine & " >> ~/Desktop/Test.txt"

So the FileMaker script would look like:

Commit Record
Go to Record [ First ]
Loop
If [ Get ( RecordNumber ) ‚ Get ( FoundCount ) ]
Perform AppleScript [ the 1st one above ]
Else
Perform AppleScript [ the 2nd one above, suppressing the extra return ]
End If
Go to Record [ Next, exit after last ]
End Loop

(P.S. the file path could also come from, or be constructed from fields in FileMaker.

Reply via email to