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
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
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: