Gmail HD + Label + Filter 的應用

1.在 Gmail 中建立一個 “Gmail HD” 的標籤(Label)

2.在 Gmail 中建立一個篩選器(Filter),寄件者跟收件者都填你自己的 Gmail 帳號,然後在主旨的地方填入 “Gmail HD” 如下圖:
Gmail HD

3.接下來只要檔案拖到 Gmail HD 的 Icon 上即可
Gmail HD

4.等個半分鐘或一分鐘(視檔案大小及網路頻寬而定),待 Mail.app 把信寄出後,再直接點選 Gmail HD 的 Icon 即可連上 Gmail,然後再點選 Gmail HD 的標籤即可
Gmail HD

5.Gmail HD 程式部份 (我稍微再小改版了一下)
AppleScript: (記得要把 Gmail 帳號改成你的帳號)

tell application "Safari"
	open location "https://mail.google.com/mail/"
end tell

property username : "請改為你的Gmail帳號" --gmail username
property newline : (ASCII character 10) --character for new line

on open of these_items
	send_message(these_items)
end open

on send_message(target_files)
	tell application "Mail"
		set n to 1
		set filenames to ""
		repeat until n is the ((length of target_files) + 1)
			set n_file to item n of target_files
			if n is less than (length of target_files) then
				set filenames to filenames & POSIX path of n_file & ", "
			else
				set filenames to filenames & POSIX path of n_file
			end if
			set n to n + 1
		end repeat

		set newMessage to make new outgoing message with properties {subject:"Gmail HD (" & filenames & ")", content:"This e-mail is meant mearly as a backup of the following files." & newline, sender:"請改為你的Gmail帳號@gmail.com"}

		tell newMessage
			make new to recipient at beginning of to recipients with properties {address:username & "@gmail.com"}
			set n to 1
			tell content
				repeat until n is the ((length of target_files) + 1)
					set n_file to item n of target_files
					set filepath to POSIX path of n_file
					make new attachment with properties {file name:filepath} at after the last word of the last paragraph
					set n to n + 1
				end repeat
			end tell
		end tell
		send newMessage
	end tell
end send_message

Comments are closed.

FireStats icon Powered by FireStats