Wednesday, November 11, 2009

Monday, October 5, 2009

How to learn English

For Japanese, English is strange, non-understandable and mysterious language. A Maximum problem of this issue is ultra differences between those languages system. For us, to learn English means to get start for long long journey to India.

If you can read Japense, follow is a funny series that tells and helps you how to study English.

Of corse, we can not get success within a few days or months, need some years hard study. But it shouldn't hard way. If we chould, tt's going to be funny way, isn't it?

Saturday, October 3, 2009

Wrap script for Thunderbird and Mail.app

If you saved script as launch_mail_compose.applescript and launch_thunderbird_compose.sh, Follow command works well for both FreeBSD/Linux and Mac OS X.
case "$(uname)" in
FreeBSD|Linux)
    MUACOMPOSER=launch_thunderbird_compose.sh
    ;;
Darwin)
    MUACOMPOSER=launch_mail_compose.applescript
    ;;
esac

${MUACOMPOSER} \
  to="hoge@example.com,moge@example.com" \
  cc="soge@example.com" \
  subject="Test sample shiken tesuto" \
  attach="/pathto/attachfile.tgz" \
  body="$(cat /pathto/mailtemplete)"

Thunderbird launch wrapper

This is a little wrapper script to launch Thunderbird mail composer, against for Mail.app compose script.
#!/bin/sh

for target in ${@+"$@"}
do
    case "${target}" in
    to=*)
      to="${target#*=}"
      ;;
    cc=*)
      cc="${target#*=}"
      ;;
    sender=*)
      sender="${target#*=}"
      ;;
    subject=*)
      subject="${target#*=}"
      ;;
    attach=*)
      attach="file://${target#*=}"
      ;;
    body=*)
      body="${target#*=}"
      ;;
    esac
done

exec thunderbird -compose "to=${to},cc=${cc},sender=${sender},subject=${subject},attachment=${attach},body=${body}"

Mail.app compose script, my first AppleScript experience!

How can I get to do automation mail composing like FreeBSD and Thunderbird doing? This weekend I have tried to make auto mail composing script by AppleScript. This is my first AppleScript experience! How do you feel of following script? It looks pretty good ;-)
#!/usr/bin/osascript

on run argv
 set argc to count item of argv
 
 repeat with i from 1 to argc
  set targetlist to textToList(item i of argv, "=")
  set target to item 1 of targetlist
  set value to item 2 of targetlist
  
  if target is "to" then
   set mailto to textToList(value, ",")
  else if target is "cc" then
   set mailcc to textToList(value, ",")
  else if target is "sender" then
   set sender to value
  else if target is "subject" then
   set subject to value
  else if target is "attach" then
   set attach to value
  else if target is "body" then
   set body to value
  end if
 end repeat
 
 return newMail(mailto, mailcc, sender, subject, attach, body) of me
end run

on newMail(mailto, mailcc, sender, subject, attach, body)
 global newMail_mailto
 global newMail_mailcc
 global newMail_sender
 global newMail_subject
 global newMail_attach
 global newMail_body
 
 set newMail_mailto to mailto
 set newMail_mailcc to mailcc
 set newMail_sender to sender
 set newMail_subject to subject
 set newMail_attach to attach
 set newMail_body to body
 
 tell application "Mail"
  set composeWindow to make new outgoing message
  set visible of composeWindow to true
  
  tell composeWindow
   set sender to newMail_sender
   set subject to newMail_subject
   set content to newMail_body
   
   set limit to count item of newMail_mailto
   repeat with i from 1 to limit
    make new to recipient with properties {address:item i of newMail_mailto}
   end repeat
   
   set limit to count item of newMail_mailcc
   repeat with i from 1 to limit
    make new cc recipient with properties {address:item i of newMail_mailcc}
   end repeat
   
   make new attachment with properties {file name:newMail_attach} at after last paragraph
  end tell
  
  (* Signature should be added after attachment treatment complete.
  If signature is added before attachment work complete, attachment
  treatment overwrites signature config and it turns into "none" signature. 
  I guess it's a bug of Mail.app. Following delay command is workaround of 
  this issue. *)
  delay 1.5
  set message signature of composeWindow to signature newMail_sender
 end tell
end newMail

on textToList(target, delimiters)
 set resultlist to {}
 
 set delimiters_org to text item delimiters of AppleScript
 set text item delimiters of AppleScript to delimiters
 set limit to count text item of target
 repeat with i from 1 to limit
  set end of resultlist to i
  set item i of resultlist to text item i of target
 end repeat
 set text item delimiters of AppleScript to delimiters_org
 return resultlist
end textToList
License is 2-term BSD License.

Friday, August 21, 2009

This Summer TaikenMura in MinamiUonuma finished!

You staying tune on Blog of TaikenMura? TaikenMura is children summer vacation camp service. They offer 2 courses, 1 week plan and 2 weeks plan. Today is final day of 2 weeks camp! Of course I have joined as one of leaders.

The camp has many plan to do including outdoor camp, guest house, homestay, mountain climbing (Hakkai Mountain!), river playing, hiking, joining local festival, bon dancing, cooking, making toys from bamboo, laundry, camp fire, and something many many other playing birth from children.

Looking TaikenMura Blog is the fastest way to understand TaikenMura. There are many pictures, so If you cannot read Japanese, you can get it. Beside, Taiken means "experience" and Mura means "village", it's Experience Village.

Incidentally, a guy of clean-shaven head on those pictures is me ;-)

Tuesday, July 7, 2009

Yes I'm IT person but sometimes on Outdoors

Yeah you know, I'm a busy IT news person. Everyday searching fresh news around all over the world and writing news, brushing up and creating new tools for my job, as well as work as FreeBSD committer, too.

But after work or on weekend, outdoor is my life :) My friend of Japanese drums, he has open his own blog as http://taiken-mura.blogspot.com/. (yeah I have helped him to create gmail account, teach how to use google applications and blogger... there is very big wall between it folks and others. He said what is IE? Hahaha)

If you have some interesting of your child summer vacation or University students summer vacation work, that's very good chance for you. Unfortunately this years applications is already closed. But if you have interested in that, get that feed and stay tune.

Thursday, January 15, 2009

Which language should I use on Blog?

Always I am wondering which language - English and Japanese - should I use on Blog. My native lang is Japanese, all SNS and web service in Japan I use Japanese of course. For English web service, ex Facebook, LinkedIn, LastFM or something like that, I use English.

What about Blogspot? Should I use English? Japanese? or Both of them?