man
のページによるとpbpaste
、
-Prefer {txt | rtf | ps}
tells pbpaste what type of data to look for in the pasteboard
first. As stated above, pbpaste normally looks first for plain
text data; however, by specifying -Prefer ps you can tell
pbpaste to look first for Encapsulated PostScript. If you spec-
ify -Prefer rtf, pbpaste looks first for Rich Text format. In
any case, pbpaste looks for the other formats if the preferred
one is not found. The txt option replaces the deprecated ascii
option, which continues to function as before. Both indicate a
preference for plain text.
ただし、(少なくとも 10.6 Snow Leopard での私の経験では) pbpaste -Prefer rtf
RTF データがペーストボードに存在する場合でも、RTF データを放棄することは決してありません。貼り付ける準備ができているものの RTF テキストを取得する他の簡単な方法はありますか?
AppleScript を試してみましたが、16 進数でエンコードされた craposascript -e 'the clipboard as «class RTF »'
の応答トンが返されます。AppleScript は、この hexdata を私が扱えるテキストに変換できますか?«data RTF 7B
7D»