Applescript Filemaker 13 Quicklook脚本

Applescript Filemaker 13 Quicklook脚本,applescript,filemaker,osx-yosemite,Applescript,Filemaker,Osx Yosemite,在Mac OSX Yosemite上运行Filemaker 13。 我们有一个quicklook脚本,在约塞米蒂之前,它一直没有问题。通常,它在容器字段中获取一个.doc/.docx文件,并在Quicklook中打开它 然而,在约塞米蒂,它会打开QLManager,然后导致Filemaker冻结和崩溃 Set Variable [ $file ; Value: ${database}::Container Field ] Set Variable [ $path ; Value: Get ( T

在Mac OSX Yosemite上运行Filemaker 13。 我们有一个quicklook脚本,在约塞米蒂之前,它一直没有问题。通常,它在容器字段中获取一个.doc/.docx文件,并在Quicklook中打开它

然而,在约塞米蒂,它会打开QLManager,然后导致Filemaker冻结和崩溃

Set Variable [ $file ; Value: ${database}::Container Field ]
Set Variable [ $path ; Value: Get ( Temporary Path ) & $file ]
Set Variable [ $script ; Value:
  Let (
    thepath = Middle( $path ; Position ($path ; "/" ; 1 ; 2 ); Length ($path) ;
    "set p to POSIX path of " & Quote (thepath) &
    "¶ do shell script \"qlmanage -p \" & quoted form of p" )
]
Export Field Contents [Database::Container Field ; "$path" ]
Perform Applescript [ $script ]
有人能告诉我这里可能出了什么问题吗?
谢谢

我使用FileMaker Pro Advanced 14.0.2在OS X Yosemite 10.10.5下运行,成功地编辑了您的脚本,演示文件如下:

Set Variable [ $_file ; Value: GetAsText ( Table::container ) ]
Set Variable [ $_fm_path ; Value: Get ( TemporaryPath ) & $_file ]
Set Variable [ $_as_path ; Value: Middle (
    $_fm_path;
    Position ( $_fm_path; "/" ; 1 ; 2 ) ;
    Length ( $_fm_path) )
]
Set Variable [ $_script ; Value: List (
    "set p to POSIX path of " & Quote ( $_as_path ) ;
    "do shell script \"qlmanage -p \" & quoted form of p" )
]

Export Field Contents [ Table::container ; “$_fm_path” ]
Perform AppleScript [ $_script ]

Exit Script []
这与您展示的内容之间的主要区别是:

  • 我直接引用了表名。实际上我不确定
    ${database}
    指的是什么。也许
    Get(文件名)
  • 为了便于调试,我将AppleScript路径存储在一个变量中

如果这不起作用,我会按照我提出的建议,在脚本编辑器中测试
$\u脚本的执行情况,在终端中测试shell的
p
变量的执行情况。我使用在OS X Yosemite下运行的FileMaker Pro Advanced 14.0.2,成功地编辑了脚本的版本10.10.5在演示文件中,如下所示:

Set Variable [ $_file ; Value: GetAsText ( Table::container ) ]
Set Variable [ $_fm_path ; Value: Get ( TemporaryPath ) & $_file ]
Set Variable [ $_as_path ; Value: Middle (
    $_fm_path;
    Position ( $_fm_path; "/" ; 1 ; 2 ) ;
    Length ( $_fm_path) )
]
Set Variable [ $_script ; Value: List (
    "set p to POSIX path of " & Quote ( $_as_path ) ;
    "do shell script \"qlmanage -p \" & quoted form of p" )
]

Export Field Contents [ Table::container ; “$_fm_path” ]
Perform AppleScript [ $_script ]

Exit Script []
这与您展示的内容之间的主要区别是:

  • 我直接引用了表名。实际上我不确定
    ${database}
    指的是什么。也许
    Get(文件名)
  • 为了便于调试,我将AppleScript路径存储在一个变量中

如果这不起作用,我会使用我给出的建议,在脚本编辑器中测试
$\u script
内容的执行情况,在终端中测试shell的
p
变量的内容脚本看起来很好,但我会先检查第三行后面的
$script
的值,确保它看起来正确,然后在终端中实际执行
$script
代码来确认它。脚本看起来很好,但我会先检查第三行后面的
$script
的值,确保它看起来正确,然后通过在终端中实际执行
$script
代码来确认。