11

FileAppleScriptのように、またはAppleScriptを使用して、メニュー見出しの下にあるすべてのメニュー項目のリストを取得する方法はありますEditか?

関連する質問をいくつか見つけましたが、正確なものはありません。グーグルでも運がない。

PhotoshopのWindowメニューで開いているファイルのリストを取得し、チェックマークが付いているファイルを見つけようとしています。

スクリーンショット-with-shadow.png

「 Applescriptでは、メニュー項目が選択/フォーカスされているかどうかを確認するにはどうすればよいですか?」のようなものと、アクセシビリティインスペクタを使用することで、2番目の部分を実行できる可能性があると思います。AXMenuItemMarkChar

スクリーンショット-with-shadow.png

4

1 に答える 1

12

私はPhotoshopを持っていませんが、これはIllustratorで機能します。

activate application "Adobe Illustrator"
tell application "System Events"
    tell process "Adobe Illustrator CS5.1"
        set xxx to name of every menu item of menu 1 of menu bar item "Window" of menu bar 1
    end tell
end tell

属性を取得するには、次を使用できます。

activate application "Adobe Illustrator"
tell application "System Events"
    tell process "Adobe Illustrator CS5.1"
        set xxx to value of attribute "AXMenuItemMarkChar" of menu item "tools" of menu 1 of menu bar item "Window" of menu bar 1
    end tell
end tell

nilシナリオ:

activate application "Adobe Illustrator"
tell application "System Events"
    tell process "Adobe Illustrator CS5.1"
        set xxx to value of attribute "AXMenuItemMarkChar" of menu item "Brushes" of menu 1 of menu bar item "Window" of menu bar 1
        try
            xxx
        on error
            -- insert your code
            beep 2
        end try
    end tell
end tell
于 2012-11-12T01:38:47.430 に答える