对于截屏视频,我想要一个设置桌面工作环境的脚本。这就是我所拥有的:
open /Applications/Google\ Chrome.app --args --incognito
osascript -e "tell application \"Chrome\" to set the bounds of the first window to {0, 10, 790, 500}"
我需要添加什么来获取Chrome窗口右侧的两个终端窗口,如此屏幕截图所示:
所有东西都应该适合1280x720的画面。
额外奖励:如何通过相同的脚本在终端中设置字体大小?
答案 0 :(得分:0)
您也可以为终端窗口提供坐标:
tell application "Terminal"
do script
set bounds of window 1 to {0, 10, 790, 500}
set bounds of window 2 to {0, 10, 790, 790}
end tell
答案 1 :(得分:0)
你实际上可以在香草Applescript中完成所有这些:
tell application "Google Chrome"
make new window with properties {mode:"incognito"}
set bounds of window 1 to {0, 10, 790, 500}
end tell
set myFontSize to 12
tell application "Terminal"
repeat while ((count windows) < 2)
set theWindow to do script "" --Opens a new window. For some reason 'make new window' doesn't work.
set font size of window 1 to myFontSize
end repeat
set bounds of window 1 to {790, 10, 1280, 360}
set bounds of window 2 to {790, 360, 1280, 720}
end tell