少し前に見つけたAppleScriptを変更して、画面/ドック/メニューバーの端から両側に約10pxのマージンがあるように、最前面のウィンドウを配置しました。
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
どんな助けでもいただければ幸いです!