List AppleScript如何查找模式并将其设置为记录或列表?

List AppleScript如何查找模式并将其设置为记录或列表?,list,find,applescript,record,bbedit,List,Find,Applescript,Record,Bbedit,在AppleScript中,我知道如何使用以下内容进行典型查找: tell application "BBEdit" activate open find window find "memberFunction\\(\\)" searching in text 1 of text document "theFile" options {search mode:grep, wrap around:true} with selecting match end tell 我可

在AppleScript中,我知道如何使用以下内容进行典型查找:

tell application "BBEdit"
    activate
    open find window
    find "memberFunction\\(\\)" searching in text 1 of text document "theFile" options {search mode:grep, wrap around:true} with selecting match
end tell
我可以进行多文件搜索查找:

tell application "BBEdit"
    activate
    find "memberFunction\\(\\)" searching in {file "path:to:project.bbprojectd:"} options {search mode:grep, showing results:true}
end tell
但是我想返回find multi结果并将其保存到一个文件中,因此我认为需要将其保存到一个记录或列表中,然后重复输入,但当我尝试时:

tell application "BBEdit"
    activate
    set findFunction to {}
    set findFunction to {find "memberFunction\\(\\)" searching in {file "path:to:project.bbprojectd:"} options {search mode:grep, showing results:true}} as list
end tell
或:

我得到一个错误:

此表达式的某些部分未返回任何结果


为什么查找未设置为记录或列表?有什么方法可以设置多文件搜索的功能吗?

错误在于您将
find
命令放在列表中


要从find命令获取记录,请执行以下操作:

显示结果的
属性必须是false,并且
返回
results
属性必须为true,否则findFunction 变量将是未定义的

以下是脚本:

tell application "BBEdit"
    set findFunction to find "memberFunction\\(\\)" searching in file "path:to:project.bbprojectd:" options {search mode:grep, showing results:false, returning results:true}
end tell
tell application "BBEdit"
    set findFunction to find "memberFunction\\(\\)" searching in file "path:to:project.bbprojectd:" options {search mode:grep, showing results:false, returning results:true}
end tell