【问题标题】:How can I run a terminal command from AppleScript?如何从 AppleScript 运行终端命令?
【发布时间】:2016-04-05 00:04:45
【问题描述】:
do shell script "screencapture -l$(osascript -e 'tell app 'Transmission' to id of window 1') ~/tempDirectory/test.png"

基本上,我想在使用传输完成下载后截取屏幕截图。

此代码在终端中工作

screencapture -l$(osascript -e 'tell app 'Transmission' to id of window 1

【问题讨论】:

  • 代码的哪一部分不工作?

标签: terminal applescript


【解决方案1】:

您尝试在一个applescript 中的shell 脚本中运行一个applescript。试试看(未经测试):

tell application "Transmission" to set wid to id of window 1

do shell script "screencapture -l" & wid

【讨论】:

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