【问题标题】:AppleScript Unable to escape multiple quotes within curl commandAppleScript 无法在 curl 命令中转义多个引号
【发布时间】:2018-03-28 08:48:28
【问题描述】:

我正在尝试在苹果脚本中运行 curl 命令,我正在执行以下操作:

set trial_1 to "/somepath"

set output to do shell script ("export TRIAL_1=" & trial_1)

set output to do shell script ("curl -H 'Content-Type: application/json' -X POST -d '{\"desiredCapabilities\":{"xcodeConfigFile\":quoted form of output}}'http://localhost:4723/wd/hub/session")

这是以“引用形式的输出”作为参数并运行。我要做的是使用输出的变量值运行。

当我在终端上尝试 curl 命令时

curl -H 'Content-Type: application/json' -X POST -d '{\"desiredCapabilities\":{"xcodeConfigFile\":"'"$TRIAL_1"'"}}'http://localhost:4723/wd/hub/session,

它就像一个魅力。我如何在applescript中传递相同的内容?

【问题讨论】:

    标签: curl applescript


    【解决方案1】:

    经过一段时间的尝试,我得到了它。

    设置输出做shell脚本(“curl -H 'Content-Type: application/json' -X POST -d '{\"desiredCapabilities\":{"xcodeConfigFile\":\"'\"$TRIAL_1\ "'\"}}'http://localhost:4723/wd/hub/session")

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-08-30
      • 1970-01-01
      • 2013-02-04
      • 1970-01-01
      • 2011-03-31
      • 1970-01-01
      • 1970-01-01
      • 2014-07-20
      相关资源
      最近更新 更多