如何从现场的FileMaker数据传递给一个AppleScript [英] How to pass data from a FileMaker field to an Applescript

查看:510
本文介绍了如何从现场的FileMaker数据传递给一个AppleScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要删除的文件开来的FileMaker我辛辛那提激光。它得到它有通过FMScript到这个位置的容器,出口领域的内容。所以我知道文件名和路径及其所有建在该记录计算领域。但我不知道如何让这些信息成为一个AppleScript使用FM12执行AppleScript的脚本步
当我辛苦code中的路径和文件名(如下图所示),它的工作原理。

I need to delete a file off of my Cincinnati Laser from FileMaker. It gets it there via a FMScript that export field contents of a container to this location. So I know the file name and the path its all built in a calculation field on that record. But I don't know how to get that info into an Applescript using the FM12 "Perform AppleScript" script step When I hard code the path and file name (Shown Below) it works.

set xpath to "Titanium Brain:Users:smartin:Desktop:Laser:1512-clr-c.cnc"
tell application "Finder"
   delete file xpath
end tell

当我尝试通过字段内容(如下图所示),这是行不通的。

When I try to pass the field contents (Shown Below) it doesn't work.

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

我是什么失踪?

推荐答案

在与计算执行AppleScript的问题始终报价和收益的管理。把严格按照下列进入​​执行AppleScript的脚本步骤的计算的AppleScript的框应该为你工作:

The problem with Perform AppleScript with calculations is always the managing of quotes and returns. Putting exactly the following into the 'Calculated Applescript' box of the 'Perform Applescript' script step should work for you:

"set xpath to " & Quote ( Laser::gCNCPath ) & ¶ &
"tell application \"Finder\"¶" &
   "delete file xpath¶" &
"end tell"

老实说,虽然,整个事情很快得到pretty丑陋pretty。如果你已经安全适当锁定,我会更倾向于把整个剧本到激光:: gCNCPath领域

Honestly, though, the whole thing gets pretty ugly pretty quickly. If you have security locked down appropriately, I'd be more inclined to put the whole script into the Laser::gCNCPath field

set xpath to "Titanium Brain:Users:smartin:Desktop:Laser:1512-clr-c.cnc"
tell application "Finder"
    delete file xpath
end tell

然后,在执行AppleScript的,你只需要调用领域:

And then, for the Perform Applescript, you only need to call the field:

Laser::gCNCPath

这篇关于如何从现场的FileMaker数据传递给一个AppleScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆