activate application "Mail"
tell application "System Events"
tell process "Mail"
if title of window 1 does not contain "Inbox" then
if value of attribute "AXFocused" of text field 1 of front window is true then
set value of attribute "AXFocused" of UI element 1 of scroll area 4 of front window to true
else
set value of attribute "AXFocused" of text field 1 of front window to true
end if
end if
end tell
end tell