将找到的每个记录集导出到单个文件?

时间:2013-03-22 20:28:02

标签: filemaker

这看起来像是一个简单的操作,但我似乎无法让FileMaker合作。

我想做什么: 1)循环遍历每个找到的记录,一次一个。 2)根据记录中的字段将该记录的内容导出为文件名。

Loop
    Set Variable[$path; Value:Get(FilePath) & "/../somefolder" & MyTable1::my_field_1]
    Export Records [No dialog; "$path"; Unicode(UTF-8)]
End Loop

但是,此脚本会将每条记录附加到同一文件中。他们似乎无法提供“出口记录”。 (单数),所以我不确定如何做到这一点。

非常感谢任何帮助。

2 个答案:

答案 0 :(得分:1)

我找到了解决方案:

Find All
Go to Record/Request/Page [First]
Loop
  Omit
  Find Omitted
  Set Field ["HTML File Name","External("DM-Export", KeyField & ".html")"]
  Export Records [Restore]
  Find All
  Go to Record/Request/Page [Exit After Last, Next]
End Loop

根据第7步: http://help.filemaker.com/app/answers/detail/a_id/3438/kw/exporting%20found%20set

答案 1 :(得分:1)

FileMaker的“导出记录”脚本步骤始终导出整个搜索结果集。您必须遍历找到的集合,并在导出之前逐个隔离每条记录:

Go to Record/Request/Page [First]
Loop
   Set Variable[$path; Value:Get(FilePath) & "/../somefolder" & MyTable1::my_field_1]
   New Window
   Show All
   Omit Record
   Show Omitted
   Export Records [No dialog; "$path"; Unicode(UTF-8)]
   Close Window
   Go to Record/Request/Page [Exit After Last, Next]
End Loop