AppleScript - Mail to Flickr and 23hq

10月 2nd, 2005 3 Comments »

Flickr 及 23hq 都有提供用 E-mail 來上傳照片的功能
利用 E-mail 來上傳照片的確方便又好用
你必須先到 http://www.flickr.com/account/uploadbyemail/ 去設定好你要寄到 Flickr 的 E-mail
以及到 http://www.23hq.com/ 你的帳號裡的 settings 處去設定好你要寄到 23hq 的 E-mail (兩邊的做法還真是像啊)
若有使用 iPhoto,在 iPhoto 中選好照片後,再點選 “電子郵件” 來寄信即可
其實這樣子就已經很方便了
另外,我參考 Gmail HD 的程式,簡單的寫了一個 AppleScript
可以很簡單的把照片(不管是從哪一個檔案夾或是直接從 iPhoto 中拉出也行)直接拖拉到 “Mail to Flickr and 23hq” 的 Icon 上即可,然後填入信件標題及內容即可自動寄出
當然,寄信的信箱還是用免費又快容量又大 Gmail 囉…:)

flickr23

另外,直接點選 Icon 就可以連到 flickr 及 23hq 的網頁去看圖片

以下是程式碼: (寄到 flickr and 23hq 的 E-mail 及 Gmail 帳號記得改成你自己的)

set the alert_message to ("我要看照片?")
tell application "Finder"
	display dialog the alert_message buttons {"是", "否"} default button 2 with icon 1
	set the user_choice to the button returned of the result
	if user_choice is "是" then
		tell application "Safari"
			open location "http://www.flickr.com/photos/改成你的帳號/"
			open location "http://www.23hq.com/改成你的帳號"
		end tell
	end if
end tell

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

on open of these_items
	--calls send_message with the list of files gotten as a droplet
	send_message(these_items)
end open

--accepts a list of files
on send_message(target_files)
	set today to current date
	set y to year of today as string
	set m to month of today as string
	set d to day of today as string

	--輸入標題及內容
	tell me to set myTitle to display dialog "請輸入標題: " default answer ("照片: " & y & m & d) buttons {"預設", "自訂"} default button 2 with icon 1 giving up after 300
	if button returned of myTitle = "自訂" then
		set mailTitle to (text returned of myTitle)
	else
		set mailTitle to ("照片: " & y & m & d)
	end if
	tell me to set myContent to display dialog "請輸入內容(照片說明): " default answer "上傳到 flickr 及 23hq 的照片" buttons {"預設", "自訂"} default button 2 with icon 1 giving up after 300
	if button returned of myContent = "自訂" then
		set mailContent to (text returned of myContent)
	else
		set mailContent to "上傳到 flickr 及 23hq 的照片"
	end if

	tell application "Mail"
		--combine filenames of all files into one string for subject
		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 message properties
		set newMessage to make new outgoing message with properties ¬
			{subject:mailTitle, content:mailContent & newline, sender:"改成你的 Gmail 帳號@gmail.com"}

		tell newMessage
			--message should be sent to self
			make new to recipient at beginning of to recipients with properties ¬
				{address:"改成你要寄到 flickr 的信箱@photos.flickr.com, 改成你要寄到 23hq 的信箱@23hq.com"}

			--add attachments from the list
			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 the message
		send newMessage

	end tell
	--tell application "Mail" to quit
end send_message

寶貝日記 - 龍王颱風來了

10月 2nd, 2005 Comments Off

Jiji: 巴比快來看,盆栽都被龍王吹倒了
龍王颱風來了

Me: Wa Cow,還真的倒了一盆咧
龍王颱風來了

Jiji: Lio 你也快來看
龍王颱風來了

Lio: OK,我再往右邊找找,你去左邊看一看還有沒有被吹倒的
龍王颱風來了

Jiji: 報告,沒有了,總共只倒了那一盆
龍王颱風來了

Lio & Jiji: 嗯,巴比快去扶起來吧
龍王颱風來了

Me: @%^#$@$!#*$(!!^*@

寶貝日記 - Lio 躺在螢幕前 (23hq 測試)

10月 2nd, 2005 Comments Off

再看 23hq

10月 2nd, 2005 Comments Off

自從買了 Flickr Pro 後,上傳照片都用 Flickr 了
剛剛在 WebLoOn’s Blog 上看到 23hq账户自动升级

於是就再 Login 進去看看
同樣的,我之前申請的帳號也變成 plus 了,沒有上傳等限制
稍微逛了一下,幾乎到處都是 Flickr 的影子 (哈,flickr 有的功能它也都加上去了)
另一方面,也多了簡/繁體中文的介面支援,這樣就好多了
不過可惜的是,繁體中文幾乎是從簡體中文轉過來的,很多用字都很 “簡體”
目前看來,若沒有上傳限制, 23hq 似乎也是不錯的選擇 (不過不知道它能撐多久就是了)
不過,以目前看來,我還是會去用 Flickr,原因很簡單,Flickr 有很多上傳工具,最重要的是 Flickr 的 iPhoto plugin,這樣我才可以很輕鬆的在 Mac 上用 iPhoto 直接就上傳照片
但現在 23hq 還沒有這樣方便的上傳工具,等這些好用的工具齊全後再說吧

Mini-Hint: Automate backups to gmail using applescript

10月 2nd, 2005 Comments Off

Mini-Hint: Automate backups to gmail using applescript

在 Mac OS X 上找不到 Gmail Drive 等程式,用這種方法倒是不錯
把檔案直接拉到 “Gmail HD” 的 Icon 上後,它就自動用 Mail.app 以附件方式幫你寄到 Gmail 上了
還算很方便

我稍微改了一下程式,一個是把最後自動把 Mail.app 關掉那行 mark 掉 (因為 Mail.app 不需要關掉啊)
另外,由於我的信件都是用 Mail.app 來收,包括 .Mac MSN Yahoo Gmail 等多個帳號都是,但我預設是用 .Mac 帳號來寄信,因為,問題又來了,這樣會變成從 .Mac 寄到 Gmail 去,雖然還是寄到了,但是速度很慢 (慢在 .Mac?),所以,我改成了用 Gmail 帳戶寄給自己,這樣一來,速度就快多了,也不用多占用一份 .Mac 的空間
底下是程式碼:(注意,有些地方要手動改一下,改成你的 Gmail 帳號)

(*
Author: Jayson Kempinger
E-mail: EvilGlowingApple@gmail.com
Date created: 7 December 2004

Gmail backup script
Drop files/folders onto this as an application.  This script will send the files as attachments in an e-mail
to the gmail address specified by the property username.

Code to send message and set the subject/body found at http://forums.macosxhints.com/showthread.php?t=31163
modified to support dropping of files and multiple files.
*)

set the alert_message to ("取回備份檔案?")
tell application "Finder"
	display dialog the alert_message buttons {"是", "否"} default button 2 with icon 1
	set the user_choice to the button returned of the result

	if user_choice is "是" then
		tell application "Safari"
			open location "https://mail.google.com/mail/"

		end tell
	end if
end tell

property username : "請改成你的 Gmail 帳號(不需要 @gmail.com)" --gmail username
property newline : (ASCII character 10) --character for new line

on open of these_items
	--calls send_message with the list of files gotten as a droplet
	send_message(these_items)
end open

--accepts a list of files
on send_message(target_files)
	tell application "Mail"

		--combine filenames of all files into one string for subject
		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 message properties
		set newMessage to make new outgoing message with properties ¬
			{subject:"File: " & filenames, content:"This e-mail is meant mearly as a backup of the following files." & newline, sender:"請改成你的 Gmail 帳號@gmail.com"}

		tell newMessage
			--message should be sent to self
			make new to recipient at beginning of to recipients with properties ¬
				{address:username & "@gmail.com"}

			--add attachments from the list
			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 the message
		send newMessage

	end tell
	--tell application "Mail" to quit
end send_message

Terminal Tips: “Uninvisible” the invisible files on your iPod

10月 2nd, 2005 Comments Off

在 tuaw.com 上看到的 Terminal Tips: “Uninvisible” the invisible files on your iPod

不過我的 iPod nano 還沒到貨,無法試,等到貨了再來試試看

30 GigaByte malibox

10月 2nd, 2005 Comments Off

30Gigs.com
All Accounts Feature:
30 GigaByte malibox
mail filtering
address book
easy search
convenient interface
100% FREE

學 Gmail 要有邀請函才能加入

說實在的,有了 Gmail 後,who care 這些幾十G甚至幾百G的空間呢?
容量大小不過在玩數字遊戲罷了
服務的品質才是重點,以及 API 是否開放,是否有一大堆的 Plugins 可以用

FireStats icon Powered by FireStats