In Camino dictionary, there is “browser window” which separates itself from other windows (like “downloads” window). How to refer to browser window in Safari (not any other window like “Downloads” window, “Activity” window) ?
I am currently using this:
tell application "Safari"
set theURL to "http://www.google.com"
my makenewurl(theURL)
end tell
on makenewurl(x)
tell application "Safari"
if name of window 1 is not "Downloads" then
tell window 1 to make new tab with properties {URL:x}
else
if name of window 2 is not "Downloads" then
tell window 2 to make new tab with properties {URL:x}
end if
end if
end tell
end makenewurl