------------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2017/03/23 17:52
# dMod: 2017/03/23 18:01
# Appl: Safari & System Events
# Task: Move focus to the URL list in bookmark and history windows after a search.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @System_Events, @Move, @Focus, @URL, @List, @Bookmark, @History, @Window, @Search
------------------------------------------------------------------------------
tell application "Safari"
set frontDocName to name of front document
end tell
if frontDocName = "Searching Bookmarks" or frontDocName = "Searching History" then
tell application "System Events"
tell application process "Safari"
tell (first window whose subrole is "AXStandardWindow")
tell splitter group 1
tell tab group 1
tell group 1
tell group 1
tell scroll area 1
tell outline 1
set focused to true
end tell
end tell
end tell
end tell
end tell
end tell
end tell
end tell
end tell
else
beep
end if
------------------------------------------------------------------------------