6

テキストに基づいて、AppleScript を使用してアウトラインの特定の行を選択しようとしています。

これが私が考えていることです(しかしうまくいきません):

repeat with aRow in rows of outline 1 of scroll area 1 of splitter group 1 of window 1
    set t to text of cell of aRow
    if t starts with "some text" then select aRow
end repeat

問題は、text of cell of aRow私が思うように解決しないことです。Accessibility Inspector を使用して、オブジェクトの階層を確認しました。行で「UI Elements」を使用して、アクセス可能な要素を確認しようとしましたが、有用なものは何も返されません。だから私は考えていません!私は何が欠けていますか?

4

2 に答える 2

1

あなたが欠けているのはstatic textだと思います。

これはiTunesでの例です。

    tell application "System Events"
        tell process "iTunes"

            --  get properties of every static text in rows of outline 1 of scroll area 1 of splitter group 1 of window 1

            get properties of first static text in rows of outline 1 of scroll area 1 of splitter group 1 of window 1 whose description is "sources"
            get properties of first static text in rows of outline 1 of scroll area 1 of splitter group 1 of window 1 whose name is "LIBRARY"
            get properties of first static text in rows of outline 1 of scroll area 1 of splitter group 1 of window 1 whose value is "Spanish"


        end tell
    end tell
于 2013-05-25T14:26:55.040 に答える