处理在 Safari 中打开网页并截取特定区域的 AppleScript(使用 Cmd+Shift+4)。但是我无法使屏幕捕获部分自动进行。
我正在使用 MouseTools 单击并移动鼠标。
set x to POSIX file ((POSIX path of (path to me)) & "/.." & "/MouseTools") as text
set pathName to POSIX path of x
tell application "Safari" to activate
open location "http://google.com"
delay 1
#do shell script quoted form of pathName & " -x 500 -y 167"
delay 1
tell application "System Events"
#keystroke "3" using {command down, shift down}
end tell
delay 1
#do shell script quoted form of pathName & " -leftClick"
ETC...
击键命令适用于除屏幕截图之外的所有内容。下一个问题是在按住左键的同时移动鼠标。有人让这个工作还是有更好的方法?