set bigList to {} property windowMenu : "Window" property nextTabMenuItem : "Select Next Tab" property AddBookmarkFolder : "Add Bookmark Folder" property Bookmarks : "Bookmarks" 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 click menu item AddBookmarkFolder of menu Bookmarks of menu bar 1 -- 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} 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 end repeat end tell