0

对于截屏视频,我想要一个设置桌面工作环境的脚本。这是我的票价:

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 框架。

奖励:如何通过相同的脚本在终端中设置字体大小?

4

2 回答 2

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
于 2013-06-12T20:47:53.697 回答
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
于 2013-06-12T21:04:41.230 回答