環境: Mac OS X 10.4.10 (PPC; 日本語優先)
sips -r
画像を回転させる sips -r の引数にはマイナスも使える
次のふたつは同じ。
sips -r -90 test.jpg --out test2.jpg
sips -r 270 test.jpg --out test2.jpg
Terminal の do script コマンドでシェルスクリプトに引数を与える
ls -avl "$1" を実行するスクリプト /Users/hoge/bin/ls.sh に Finder の最前面ウインドウの target を与えたい場合。
tell application "Finder"
set theDir to POSIX path of ((target of Finder window 1) as Unicode text)
end tell
tell application "Terminal"
activate
do script "/Users/hoge/bin/ls.sh " & quoted form of theDir
end tell
AppleScript で Mail.app の選択文字列を取得
tell application "System Events"
tell process "Mail"
tell scroll area 2 of splitter group 1 of window 1
set headerSelection to (value of attribute "AXSelectedText" of text area 1)
--ヘッダの選択部分
set bodySelection to (value of attribute "AXSelectedText" of text area 2)
--本文の選択部分
end tell
end tell
end tell
if headerSelection is not "" then
set theText to headerSelection & return & return & bodySelection
else
set theText to bodySelection
end if
AppleScript で BathyScaphe の選択文字列を取得してレス間に改行を挿入
tell application "System Events"
tell process "BathyScaphe"
set theText to (value of attribute "AXSelectedText" of text area 1 of scroll area 2 of splitter group 1 of window 1)
end tell
end tell
set bs to «data utxt005C» as Unicode text
set dq to (ASCII character 34) as Unicode text
set gsubText to (do shell script "echo -n " & quoted form of theText & " | ruby -ne 'print $_.gsub(/^" & bs & "d{1,4}" & bs & "s名前.+Mail.+投稿日.+/) { | matched |; " & dq & bs & "n" & dq & " + matched; }'")
set p1 to (paragraph 1 of gsubText)
if p1 is "" then
set gsubText to (do shell script "echo -n " & quoted form of gsubText & " | tr '" & bs & "r' '" & bs & "n' | tail +2")
end if
gsubText
.ace ファイルを展開できるソフト
The Unarchiver
UnaceX
MacUnace
UnaceX 1.2 と MacUnace 2.5 の実行ファイル (unace) はどうやら同じバージョン。
MacUnace の使い方。(bash)
file.ace がデスクトップにあるとして
$ cd ~/Desktop
$ unace e file.ace ./the_folder/
~/Desktop/the_folder にファイルが展開される。
***ディレクトリ名の後にスラッシュをつけないとエラーになる。***
展開先として指定したディレクトリが存在しない場合、新規にディレクトリが作成される。
展開先を指定しないとカレントディレクトリにバラバラと中身が展開される。