| スクリプト名:Jedit Xで赤文字部分をクリップボードへ 【コメント】 Jedit Xのドキュメント中で、文字色を「赤」に設定している箇所をクリップボードに転送します。書類やデータのチェックを行うのに便利です。 By ぴよまるソフトウェア |
| set redColorAttr to {65535, 0, 0} --「赤」。ここを変えると他の色でマークした箇所をリストアップ --文字データと文字色データを取得 tell application "Jedit X" set aCount to count every document if aCount = 0 then display dialog "No Documents" return end if tell first document set allText to attribute runs set allColor to color of attribute runs end tell end tell set allText_ref to a reference to allText set allColor_ref to a reference to allColor set aLen to length of allText_ref set outDataList to {} set outDataList_ref to a reference to outDataList --マーキング抽出 repeat with i from 1 to aLen if item i of allColor_ref is redColorAttr then set the end of outDataList_ref to item i of allText_ref end if end repeat --リストを改行で区切ったデータに変換 set curDelim to AppleScript's text item delimiters set AppleScript's text item delimiters to {return} set targetText to outDataList as text set AppleScript's text item delimiters to curDelim --クリップボードに転送 set the clipboard to targetText |