Kevin. Sono l'autore del post a cui ti sei collegato su incrementalism.net.
Il motivo per cui la finestra del terminale si sposta in alto è solo un bug nel supporto AppleScript di Terminal.
Questa versione esegue il centramento verticale e aggira il bug del terminale:
tell application "Finder"
set screenSize to bounds of window of desktop
set screenWidth to item 3 of screenSize
set screenHeight to item 4 of screenSize
end tell
tell application "System Events"
set myFrontMost to name of first item of ¬
(processes whose frontmost is true)
end tell
try
tell application myFrontMost
set windowSize to bounds of window 1
set windowXl to item 1 of windowSize
set windowYt to item 2 of windowSize
set windowXr to item 3 of windowSize
set windowYb to item 4 of windowSize
set windowWidth to windowXr - windowXl
set windowHeight to windowYb - windowYt
if myFrontMost is "Terminal" then
set bounds of window 1 to {¬
round ((screenWidth - windowWidth) / 2) rounding as taught in school, ¬
round ((screenHeight + windowHeight) / 2) rounding as taught in school, ¬
round ((screenWidth + windowWidth) / 2) rounding as taught in school, ¬
round ((screenHeight + windowHeight) / 2 + windowHeight) rounding as taught in school}
else
set bounds of window 1 to {¬
round ((screenWidth - windowWidth) / 2) rounding as taught in school, ¬
round ((screenHeight - windowHeight) / 2) rounding as taught in school, ¬
round ((screenWidth + windowWidth) / 2) rounding as taught in school, ¬
round ((screenHeight + windowHeight) / 2) rounding as taught in school}
end if
set the result to bounds of window 1
end tell
end try
Spero che questo aiuti, se non hai già pagato per una delle altre opzioni. Ho anche aggiunto un commento con questa soluzione alternativa al post originale.