我如何 运行 来自 AppleScript 的终端命令?
How can I run a terminal command from 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
您尝试在 shell 脚本中 运行 applescript 中的 applescript。试一试(未经测试):
tell application "Transmission" to set wid to id of window 1
do shell script "screencapture -l" & wid
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
您尝试在 shell 脚本中 运行 applescript 中的 applescript。试一试(未经测试):
tell application "Transmission" to set wid to id of window 1
do shell script "screencapture -l" & wid