Friday, January 19, 2018

#1 2003-05-13 08:53:21 pm

Trash Man
Sanitation Department
Registered: 2005-10-20
Posts: 5336

Get Safari Tab Info

This script uses Apple's UI scripting to obtain the name and URL of each tab in the front window of Safari. I hope Apple adds scripting support for tabs because this is a poor substitute.

OS version:

Applescript:

set targetURLs to {}
tell application "Safari" to activate

tell application "System Events" to tell application process "Safari"
   set tabNames to name of radio buttons of window 1
end tell

tell application "Safari"
   repeat with thisTab in tabNames
       tell application "System Events"
           tell application process "Safari"
               tell radio button named thisTab of window 1 to click
           end tell
       end tell
       copy {aURL:URL of document of window named thisTab, aTab:contents of thisTab} to end of targetURLs
   end repeat
end tell
targetURLs


One mans trash is another mans treasure


Filed under: safari, System

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)