Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Applescript或Bash脚本打开第三方应用程序(来自身份不明的开发人员)_Bash_Scripting_Terminal_Applescript - Fatal编程技术网

使用Applescript或Bash脚本打开第三方应用程序(来自身份不明的开发人员)

使用Applescript或Bash脚本打开第三方应用程序(来自身份不明的开发人员),bash,scripting,terminal,applescript,Bash,Scripting,Terminal,Applescript,我已经创建了一个运行bash脚本并启动应用程序的AppleScript 我已将AppleScript保存为应用程序 在我的计算机上,bash脚本运行,应用程序也运行;但是,在另一台计算机上,AppleScript无法打开应用程序,因为它来自身份不明的开发人员 有没有办法让AppleScript打开应用程序,即使它来自一个身份不明的开发人员?有没有办法用bash脚本打开应用程序 我知道如何在bash脚本中打开应用程序,但它遇到了相同的问题(未知开发人员错误) 我不想改变我的系统偏好。我正在寻找

我已经创建了一个运行bash脚本并启动应用程序的AppleScript

  • 我已将AppleScript保存为应用程序

  • 在我的计算机上,bash脚本运行,应用程序也运行;但是,在另一台计算机上,AppleScript无法打开应用程序,因为它来自身份不明的开发人员

  • 有没有办法让AppleScript打开应用程序,即使它来自一个身份不明的开发人员?有没有办法用bash脚本打开应用程序

    • 我知道如何在bash脚本中打开应用程序,但它遇到了相同的问题(未知开发人员错误)

    • 我不想改变我的系统偏好。我正在寻找一种通过编程实现的方法,这样任何用户都可以在他们的机器上运行AppleScript

    • 如果用户必须“右键单击,打开”最终的AppleScript才能运行Apple脚本,那么它只需要打开脚本正在打开的应用程序,而无需再次“右键单击,打开”

    以下是我的AppleScript代码:

    tell application "Finder" to get POSIX path of ((path to me as text) & "::")
    set scriptPath to quoted form of result & "BrewInstall.command"
    tell application "Finder" to get POSIX path of ((path to me as text) & "::")
    set appPath to result & "OracleInstall.app"
    tell application appPath
        activate
    end tell
    
    tell application "Terminal"
        activate
        do script scriptPath
    end tell
    

    如果首先删除隔离属性,则该属性应能正常工作:


    执行shell脚本“xattr-d com.apple.quantial&appPath”

    我想我已经搞定了。首先我切换了“tell块”。在“tell application'Terminal'”块中,我执行一个shell脚本,将cd发送到应用程序所在的目录。然后执行另一个shell脚本,将chmod作为应用程序