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
答案 0 :(得分:2)
您尝试在Apple脚本内的shell脚本中运行applescript。试试(未经测试):
tell application "Transmission" to set wid to id of window 1
do shell script "screencapture -l" & wid