chrome tabs to clipboard applescript

都合により午前休になってしまったので、以前Safariで使っていたのをchromeにしてから放置していた日記コピペ用スクリプトを作った。

(*
chrome URLs to clipboard
kinneko@gmail.com
2012.01.12
*)

set url_list to {}

tell application "Google Chrome"
	activate
	set chromeWindow to window 1
	repeat with w in chromeWindow
		try
			repeat with t in (tabs of w)
				set TabTitle to (title of t)
				set TabURL to (URL of t)
				set TabInfo to ("* " & TabTitle & return & TabURL & return)
				copy TabInfo to the end of url_list
			end repeat
		end try
	end repeat
end tell

-- convert url_list to text
set old_delim to AppleScript's text item delimiters
set AppleScript's text item delimiters to return
set url_list to url_list as text
set AppleScript's text item delimiters to old_delim
set the clipboard to url_list