将数据从AppleScript发送到FileMaker记录

时间:2013-04-02 19:09:51

标签: applescript filemaker

我正在计算AppleScript中的一些数据,然后我将其插入到特定的FileMaker记录中。这是我的AppleScript:

on sendDataToFM(FileNameWithExtension, ClipLength)
    tell application "FileMaker Pro Advanced"

        show every record of database 1
        show (every record whose cell "File Name" = FileNameWithExtension)

        repeat with i from 1 to (count record)
            set MatchingRecord to record i
            set data cell "CLIP LENGTH" of MatchingRecord to ClipLength
        end repeat

    end tell
end sendDataToFM

...

my sendDataToFM('Some Video.mov', '00:01:22.55')

一切正常 除了

set data cell "CLIP LENGTH" of MatchingRecord to ClipLength

返回的错误是

(*Can’t get cell "CLIP LENGTH" of {"Some Video.mov",  ... }.*)

脚本找到正确的记录,FileMaker字段名称肯定是“CLIP LENGTH”。我做错了什么?

1 个答案:

答案 0 :(得分:4)

尝试:

on sendDataToFM(FileNameWithExtension, ClipLength)
    tell application "FileMaker Pro"
        show (every record of current table whose cell "File Name" = FileNameWithExtension)
        repeat with i from 1 to (count record)
            set cell "CLIP LENGTH" of (record i) to ClipLength
        end repeat
    end tell
end sendDataToFM

my sendDataToFM("Some Video.mov", "00:01:22.55")