Isso, embora possível, pode ser um pouco complicado demais com um script. Aqui está um exemplo de script parcial que restaura o Firefox e o iTunes (adaptado do script encontrado aqui .)
property numFFWindows : 0
property FFPos : {}
property FFSize : {}
property iTunesPos : {}
property iTunesSize : {}
display dialog "Set Window Position or Save Window Position?" buttons {"Restore", "Save"} default button "Restore"
set theResult to result
tell application "System Events"
if (button returned of theResult is "Restore") then
-- Restore Settings
if (numFFWindows > 0) then
tell process "Firefox"
repeat with i from 1 to numFFWindows
set position of window i to (item i of FFPos)
set size of window i to (item i of FFSize)
end repeat
end tell
end if
if (iTunesPos is not {0, 0}) then
tell process "iTunes"
set position of window 1 to iTunesPos
set size of window 1 to iTunesSize
end tell
end if
else
-- Save Settings
tell process "Firefox"
set numFFWindows to count windows
set FFPos to {}
set FFSize to {}
repeat with i from 1 to numFFWindows
set end of FFPos to (position of window i)
set end of FFSize to (size of window i)
end repeat
end tell
tell process "iTunes"
set iTunesPos to position of window 1
set iTunesSize to size of window 1
end tell
end if
end tell
Eu sugiro que você veja este utilitário para mais flexibilidade: