如何从AppleScript运行终端命令?

时间:2016-04-05 00:04:45

标签: terminal applescript

do shell script "screencapture -l$(osascript -e 'tell app 'Transmission' to id of window 1') ~/tempDirectory/test.png"

基本上我想在使用Transmission完成下载时获取屏幕截图。

此代码适用于终端

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

1 个答案:

答案 0 :(得分:2)

您尝试在Apple脚本内的shell脚本中运行applescript。试试(未经测试):

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

do shell script "screencapture -l" & wid