Cant paste list of files to a filemaker field... help!!!

Hi, I am trying to make an applescript to paste code from an appleScript, but its send an error! pleas help!!!

Here is my script:


set SourceFolder to (choose folder with prompt "Choose folder" without invisibles) as string
tell application "System Events"
	set allfiles to every file of folder SourceFolder whose name contains "xml"
	set allfiles to allfiles as text
end tell

tell application "FileMaker Pro"
	tell window 1
		set cell "DBASE::Field_01" of current record to allfiles
	end tell
end tell

any idea will be most helpful

Thank you!

Brian

Hi,

you cannot coerce a list of file specifiers to text.
To get a list of file paths just retrieve the path property of every file


set allfiles to path of every file of folder SourceFolder whose name contains "xml"

I recommend to set text item delimiters to a new line character to get a better readable result


set SourceFolder to (choose folder with prompt "Choose folder" without invisibles) as string
tell application "System Events"
	set allfiles to path of every file of folder SourceFolder whose name contains "xml"
end tell
set {TID, text item delimiters} to {text item delimiters, return}
set allfiles to allfiles as text
set text item delimiters to TID

tell application "FileMaker Pro"
   tell window 1
       set cell "DBASE::Field_01" of current record to allfiles
   end tell
end tell

Its works perfect! Thank you very much!!! :D:D:D:D:D:D:D