08)ちょっとした便利スクリプト

| コメント(0) | トラックバック(0)

アスキーナンバーで文字を指定したり逆にアスキーナンバーを調べます。

set myChar to ASCII character (34)
set myNum to ASCII number "A"
--ちなみに改行はreturnでタブはtabです。

下記はクリップボードを操作します。コピーした文字列を取り出したり、クリップボードにテキストを入れて、ペーストすることができます。

set the clipboard to "123"--クリップボードに文字列を入れる
set myTable to the clipboard--クリップボードから文字列を取り出す

下記はSORTです。早くありませんが、リストを並べ替えます。

on SORT(myList)
        set myCount to count items of myList
        repeat
                set myFLG to false
                repeat with N from 1 to myCount - 1
                        set buf1 to item N of myList
                        set buf2 to item (N + 1) of myList
                        if buf1 < buf2 then
                                set item N of myList to buf2
                                set item (N + 1) of myList to buf1
                                set myFLG to true
                        end if
                end repeat
                if myFLG is false then
                        exit repeat
                end if
        end repeat
        return myList
end SORT

トラックバック(0)

トラックバックURL: http://www.adg7.com/mt/mt-tb.cgi/38

Comments are nofollow setting

コメントする

エントリー一覧

OpenID対応しています OpenIDについて
Powered by Movable Type 7.902.0
漢字イラストロジック-脳トレ京
FREE ONLINE SUDOKU