Saya menggunakan AppleScripts ini:
try
tell application "Finder"
set b to bounds of window of desktop
end tell
try
tell application (path to frontmost application as text)
set bounds of window 1 to {0, 22, (item 3 of b) / 2, item 4 of b}
end tell
on error
tell application "System Events" to tell window 1 of (process 1 where frontmost is true)
set position to {0, 22}
set size to {(item 3 of b) / 2, (item 4 of b) - 22}
end tell
end try
end try
try
tell application "Finder"
set b to bounds of window of desktop
end tell
try
tell application (path to frontmost application as text)
set bounds of window 1 to {((item 3 of b) / 2), 22, item 3 of b, item 4 of b}
end tell
on error
tell application "System Events" to tell window 1 of (process 1 where frontmost is true)
set position to {(item 3 of b) / 2, 22}
set size to {(item 3 of b) / 2, (item 4 of b) - 22}
end tell
end try
end try
Skrip pertama-tama mencoba memberi tahu aplikasi untuk mengubah properti batas dan kemudian memberi tahu System Events untuk mengubah properti posisi dan ukuran. Menggunakan System Events (atau API aksesibilitas) berfungsi dengan lebih banyak aplikasi, tetapi ini juga dapat tampak agak suram karena posisi dan ukuran tidak berubah pada saat yang sama. Aplikasi lain seperti Slate selalu menggunakan aksesibilitas API.