tell application "System Events" set myApp to name of first application process whose frontmost is true if myApp is "DEVONagent" then tell application "DEVONagent" set myURL to URL of window 1 end tell else if myApp is "firefox-bin" then tell application "Firefox" set myURL to «class curl» of window 1 end tell else if myApp is "Opera" then tell application "Opera" set myInfo to GetWindowInfo of window 1 set myURL to item 1 of myInfo end tell else if myApp is "OmniWeb" then tell application "OmniWeb" set myURL to URL of document 1 end tell else return end if end tell do shell script "open -a safari " & quoted form of myURL delay 1 set bigList to {} property windowMenu : "Window" property nextTabMenuItem : "Select Next Tab" -- property AddBookmarkFolder : "Add Bookmark Folder" -- doesn't work on localized systems! -- property AddBookmarkFolder : "Lesezeichen-Ordner hinzufügen" -- works on German systems (added by Lou Kash) -- try the ID: property AddBookmarkFolder : 4 -- tested on Panther, Safari 1.3.1 (added by Lou Kash) -- property Bookmarks : "Bookmarks" -- doesn't work on localized systems! -- property Bookmarks : "Lesezeichen" -- works on German systems (added by Lou Kash) -- try the ID: property Bookmarks : 7 -- tested on Panther, Safari 1.3.1 (added by Lou Kash) property newbookmark : "New Bookmark" property cut : "x" property paste : "v" set lastUrl to "" set firstUrl to "" tell application "Safari" activate set firstUrl to URL of document 1 repeat until firstUrl is equal to lastUrl tell application "System Events" tell process "Safari" keystroke (ASCII character 29) using [command down, shift down] tell application "Safari" copy URL of document 1 to end of bigList set lastUrl to URL of document 1 end tell end tell end tell end repeat end tell tell application "Safari" activate tell application "System Events" tell process "Safari" -- add bookmark folder keystroke "N" using [shift down, command down] -- name the folder "Saved Tabs - " set theDate to (current date) as string keystroke "Saved Tabs - " & theDate -- hit return to name the folder keystroke return -- programming a tab will not select the bookmarks area, so have to... (* -- create a new subfolder -- and then delete it keystroke "[" using {command down} keystroke "]" using {command down} keystroke cut using {command down} *) -- ... wait two seconds and then enter a tabulator character... :-) (added by Lou Kash) delay 2 keystroke (ASCII character 9) delay 1 end tell end tell end tell tell application "Safari" set the counter to 0 set the item_counter to count of the the bigList repeat item_counter times set counter to counter + 1 set this_url to item counter of the bigList -- use a try statement to avoid undefined error try set the clipboard to this_url if (this_url is not equal to "bookmarks://") then tell application "System Events" tell process "Safari" keystroke paste using {command down} end tell end tell end if end try delay 1 -- added by Lou Kash end repeat end tell tell application "Safari" quit end tell