My_Play_Lists ~BlackCatWhiteTail’s blog~

Talk About My Favorite Songs

applescript numbers > 任意の行列数のtableを準備する

任意の行列数のtableを準備する

make a table with number of rows and columns which we want

tell application "Numbers"
    activate
    make document
    tell document 1
        tell sheet 1
            delete every table
            make table with properties {row count:20, column count:20} -- (1)
            make table --(2)
            tell table 2
                set column count to 6
                set row count to 5
            end tell
        end tell
    end tell
end tell
行列数の指定:その1

(1)だと簡潔に書ける.
ただし,rows:10だとエラーになる.おそらくバグ(もしくは嫌がらせ?).
したがって,行数10で準備したいときは11行準備して1行削除するなどする.

行列数の指定:その2

(2)でも可.ただし,自動で設定された行,列の初期値と同じ行数,列数をの指定するとエラー.

もとのtableの削除して新たにtableを作る.
  • 取り回しをよくするために,新たにtableを作る.
  • applescriptでよく使われるset X to make new Yを用いて,ターゲットとするdocument,sheet,tableに名前をつける.
  • ただし,ここではsheetはもとからあるものに使う.
  • ついでに,行の高さと列の幅を指定する.
tell application "Numbers"
    activate
    set tgtDoc to make document
    tell tgtDoc
        set tgtSheet to front sheet
        tell tgtSheet
            delete every table
            set tgtTable to make new table with properties {row count:20, column count:20, header row count:0, header column count:0}
            tell tgtTable
                set height of every row to 20
                set width of every column to 20
            end tell
        end tell
    end tell
end tell

 このウェブサイトについて

 練習用のサイトです.

 自分の好きな曲について感想を述べます.

 また,世に役に立つかもと考えたことも書きます.

 

TOP 1 To 5

Title Artist Album
ロックバンド 中村中 私を抱いて下さい
犬の生活 SEX MACHINEGUNS SEX MACHINEGUNS
Megalovania Toby Fox UNDERTALE Soundtrack
Bokura No Fly Away Base Ball Bear Bokura No Fly Away - single
人魚の檻 陰陽座 迦陵頻伽(Ka Ryo Bin Ga