【问题标题】:mac automator multiple instances of app with selected filemac automator 具有选定文件的应用程序的多个实例
【发布时间】:2017-06-02 19:12:06
【问题描述】:

我正在编写一个自动化脚本,每次双击选定的 nii.gz 文件时,它都会打开应用程序 fslview 的新实例。所有使用 & 运算符“运行 shell 脚本”以使 fslview 在后台运行的尝试都失败了。我设法使用“运行applescript”与

do shell script "open -n /usr/local/fsl/bin/fslview"

打开多个 fslview 实例。如何将所选文件的路径和名称从“获取选定的查找器项目”传递给 fslview?我用于所需行为的终端命令如下所示:

fslview some_image.nii.gz &

提前致谢, 马丁

顺便说一句:当我运行以下脚本时,我得到一个打开 fslview 应用程序的无限循环

on run {input, parameters}
    set f to (input as text)
    set f to POSIX path of f
    do shell script "open -n /usr/local/fsl/bin/fslview.app " & f
end run

【问题讨论】:

    标签: macos applescript automator


    【解决方案1】:

    我找到了解决办法:

    on run {input, parameters}
        set f to POSIX path of (input as text)
        do shell script "source ~/.bash_profile"
        do shell script "open -n -a fslview.app --args " & f
    end run
    

    【讨论】:

      猜你喜欢
      • 2018-09-09
      • 2019-05-20
      • 2014-01-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多