如何将数据从FileMaker字段传递到Applescript

如何将数据从FileMaker字段传递到Applescript,applescript,filemaker,Applescript,Filemaker,我需要从FileMaker中删除辛辛那提激光器的一个文件。它通过一个FMScript将容器的字段内容导出到此位置。因此,我知道文件名和路径,它们都内置在该记录的计算字段中。但我不知道如何使用FM12“执行Applescript”脚本步骤将该信息输入Applescript 当我硬编码路径和文件名(如下所示)时,它可以工作 set xpath to "Titanium Brain:Users:smartin:Desktop:Laser:1512-clr-c.cnc" tell application

我需要从FileMaker中删除辛辛那提激光器的一个文件。它通过一个FMScript将容器的字段内容导出到此位置。因此,我知道文件名和路径,它们都内置在该记录的计算字段中。但我不知道如何使用FM12“执行Applescript”脚本步骤将该信息输入Applescript 当我硬编码路径和文件名(如下所示)时,它可以工作

set xpath to "Titanium Brain:Users:smartin:Desktop:Laser:1512-clr-c.cnc"
tell application "Finder"
   delete file xpath
end tell
当我试图传递字段内容(如下所示)时,它不起作用

set xpath to Laser::gCNCPath
tell application "Finder"
   delete file xpath
end tell

我缺少什么?

执行带计算的AppleScript的问题始终是引号和返回的管理。将以下内容准确地放入“执行Applescript”脚本步骤的“计算Applescript”框中应该对您有用:

"set xpath to " & Quote ( Laser::gCNCPath ) & ¶ &
"tell application \"Finder\"¶" &
   "delete file xpath¶" &
"end tell"
老实说,整件事很快就变得很难看了。如果您适当地锁定了安全性,我会更倾向于将整个脚本放在Laser::gCNCPath字段中

set xpath to "Titanium Brain:Users:smartin:Desktop:Laser:1512-clr-c.cnc"
tell application "Finder"
    delete file xpath
end tell
然后,对于执行Applescript,只需调用以下字段:

Laser::gCNCPath

每当我需要将信息从FileMaker传递到AppleScript时(我承认,我这么做已经有一段时间了),我都会在“执行AppleScript”对话框中使用本机AppleScript字段,并使用全局字段存储AppleScript需要的“参数”,并使用AppleScript提取该信息

set xpath to cell "gCNCPath" of layout "Laser" of current file -- double check this syntax, I'm working from memory
tell app "Finder" to delete file xpath

您可以记录第二个脚本中xpath的值吗?请尝试将此作为第二行(不带引号):“显示对话框(xpath作为字符串)”。我的直觉是,这与将xpath值正确地输入Applescript有关。