【问题标题】:Filemaker 13 Quicklook ScriptFilemaker 13 快速查看脚本
【发布时间】:2015-10-16 14:46:06
【问题描述】:

在 Mac OSX Yosemite 上运行 Filemaker 13。 我们有一个 quicklook 脚本,直到 Yosemite 之前,它都可以正常工作。通常,它会在容器字段中获取一个 .doc/.docx 文件并在 Quicklook 中打开它。

但是在 Yosemite 中,它会打开 qlmanage,然后导致 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 ]

谁能给我一些关于这里可能出了什么问题的想法? 谢谢

【问题讨论】:

  • 脚本看起来不错,但我会通过检查第三行之后的 $script 的值并确保它看起来正确,然后通过在终端中实际执行 $script 代码来确认这一点.

标签: applescript filemaker osx-yosemite


【解决方案1】:

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

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 ( FileName )
  • 为了便于调试,我将 AppleScript 路径存储在一个变量中。

如果这不起作用,我会使用我给出的关于在 脚本编辑器 中测试 $_script 内容的执行以及 shell 的 p 变量的内容的建议在终端中。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多