1
我修改了一些前面找到的AppleScript,以某種方式放置最前面的窗口,因此屏幕/停靠欄/菜單欄的邊緣每邊都有大約10px的邊距:Applescript設置所有窗口的窗口範圍
set front_app to (path to frontmost application as Unicode text)
tell application "Finder"
set _b to bounds of window of desktop
set scrn_width to item 3 of _b
set scrn_height to item 4 of _b
end tell
tell application front_app
activate
set bounds of window 1 to {10, 35, (scrnWidth - 10), (scrnHeight - 80)}
end tell
問題是我必須爲每個窗口單獨做。我想只運行一次,並在每個應用程序的所有窗口上都能正常工作。
我試着修改5個不同的腳本,但只是得到錯誤。這裏是我有:
tell application "System Events"
tell application "Finder"
set _b to bounds of window of desktop
set scrn_width to item 3 of _b
set scrn_height to item 4 of _b
end tell
set _windows to get windows of (application processes whose visible is true)
repeat with this_window in (items of _windows)
set bounds of this_window to {10, 35, (scrn_width - 10), (scrn_height - 80)}
end repeat
end tell
任何幫助,將不勝感激!
謝謝!我稍微修改了一下,以便它可以遍歷所有打開的應用程序(需要一段時間,哈哈 - 我在AppleScript上不是很棒)。 https://gist.github.com/anonymous/5020503 – 2013-02-23 17:14:26