Setting Filemaker field

Hello all
I am trying to write a script to attach to a folder to set the folder contents to a field in a filemaker file “IBSTEST.fp5” so that I can track the folder contents. So far, I have

tell application “Finder”
set folder_to_list to “G4:Invoiceprocessor”
set list_of_items to list folder folder_to_list
set var89 to result
end tell

which gets the correct result

However, adding

tell application “FileMaker Developer”
set cell “foldercontents” of current record of database “IBSTEST.fp5” to var89
end tell

generates an error.

What am I doing wrong please?

TIA
Rod

First, you don’t need to involve the Finder in this since “list folder” belongs to StandardAdditions.osax. The likely problem is that var89 ends up holding a list of items. The following will convert the list to a text string that should work.

set var89 to ""

set folder_to_list to "G4:Invoiceprocessor"
set list_of_items to list folder folder_to_list

repeat with item_ in list_of_items -- convert list to text string
	set var89 to var89 & (item_ & ", ")
end repeat

set var89 to text 1 thru -3 of var89 -- remove trailing comma and space on last item

– Rob

It is probably a little more efficient to use text item delimiters to coerce the list to a string and I believe you should use the cellValue property in FM:

Jon


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]

Brilliant!!!
Thanx Jon and Rob - it’s working a treat now
That works a treat

Rod

I agree with Jon. Shame on me for taking the lazy way out! :oops:

– Rob