0

我需要让应用程序“Grab”在 xcode 3.2 中使用 applescript 捕获一个窗口。这可能是什么脚本?

4

2 回答 2

1

我没有在 AppleScript World 中找到任何可直接使用的东西,所以我建议使用screencapture- 一个命令行工具 - 并从你的脚本中调用它。man screencaptureTerminal.app中执行以查看其手册。

旁注:执行 shell 脚本的 AppleScript 命令是do shell script(来自“StandardAdditions”)。

(“Grab”不支持 AppleScript)

于 2013-01-30T18:29:09.003 回答
1

以下 applescript 代码将截取屏幕的一部分并将其保存到桌面上的文件中。如上所述,它使用屏幕截图应用程序。

set x1 to 0
set x1 to x1 + 1
set thename to "screencapture -x -R20,20,640,380 ~/Desktop/screen_" & x1 & ".png"

tell application "Terminal"

activate

do script thename in window 1

end tell
于 2018-12-01T21:54:58.590 回答