06/10/08 01:04:44 /yi0zPpz0
改正
ダイアログの表示と同時にIMを切り替える方法。
多分、環境依存なのでsleepの値など変えるといいと思う。
あと、コマンド+スペースでIMを英数とかなで切り替わるように設定
URLリンク(www.occn.zaq.ne.jp)
これをApplicationsフォルダにインストール
open /Applications/StartupIM_carb_J
sleep 2
res=$(CocoaDialog inputbox --title "I Need Input" ?
--informative-text "Please give me a string:" ?
--button1 "Okay" --button2 "Cancel")
[[ $(head -n1 <<<"$res") == "2" ]] && exit_discard
res=$(tail -n1 <<<"$res")
echo -n "$res"
osascript << EOF
tell application "System Events"
keystroke " " using command down
end tell
EOF