Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Script modifications' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Script modifications
Authored by: Lou Kash on Nov 30, '05 10:03:43AM
For Stand users this script is not necessary indeed, but nevertheless I have modified some portions of the script to make it work on international systems, at least on Panther (I don't know if the menu ids have changed in Safari 2).



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
			click menu item AddBookmarkFolder of menu Bookmarks of menu bar 1
			-- name the folder "Saved Tabs - <current date>"
			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



[ Reply to This | # ]
Script modifications
Authored by: mark hunte on Nov 30, '05 11:00:07AM

eystroke (ASCII character 9)

God You know I swear I tried tabbing over but could not get it to do so. So did not try
it in the script. Oh well .

I have another one of these scripts I writing up, so that saves it having one more
Kludge.

Also thank everyone else for the comments on the other apps.
For me I do not like to load to many third party apps on the back end of my Apple apps.

---
mh



[ Reply to This | # ]