首页 > 解决方案 > 将 jar 运行到苹果脚本中

问题描述

我需要从带有苹果脚本的打包应用程序中启动一个 .jar 文件(带有这些参数)。

我尝试使用警告框,但它不起作用...

on run {input, parameters}

set arg_s to ""

set sh to "DIR=$(dirname \"$0\") && cd \"$DIR\" || exit; pwd"
set pwd to do shell script "/bin/bash -c " & sh's quoted form & " " & (path to me)'s POSIX path's quoted form

repeat with argument in parameters
    copy arg_s & " " & argument to arg_s
end repeat

display notification arg_s with title arg_s subtitle arg_s sound name "Frog"

-- do shell script "java -jar " & pwd & "/Application.app/Contents/Java/App.jar" & result

return input
end run

请看错误截图:

错误截图

非常感谢..

标签: javamacosjarargumentsapplescript

解决方案


推荐阅读