System Events でプレビューを操作する
System Events でプレビューの表示を2ページにするスクリプトです。
(注:System Eventsを利用するには、システム環境設定>ユニバーサルアクセスの下にある、「補助装置にアクセスできるようにする」にチェックを入れておきます)
set theApp to “Preview”
tell application theApp
activate
tell application “System Events” to tell process theApp to tell menu bar 1
get name of menu bar items
–{“Apple”, “プレビュー”, “ファイル”, “編集”, “表示”, “移動”, “ツール”, “ブックマーク”, “ウインドウ”, “ヘルプ”}
set mt to 5
get name of menu bar item mt
tell menu bar item mt to tell menu 1
get name of menu items
–{“PDF 表示”, “プロファイルを使ってソフトプルーフ”, “書類の背景を表示”, “自動的にサイズ変更”, missing value, “実際のサイズ”, “ウインドウに合わせる”, “拡大”, “縮小”, “選択部分に合わせて拡大”, missing value, “サイドバー”, “注釈ツールバーを表示”, “メモを表示”, “ツールバーを隠す”, “ツールバーをカスタマイズ…”, missing value, “スライドショー”}
set mi to 1
get name of menu item mi
–”PDF 表示”
tell menu item mi to tell menu 1
get name of menu items
–{“単一ページ”, “単一ページ(連続)”, “2 ページ”, “2 ページ(連続)”, missing value, “切り取りボックス”, “メディアボックス”}
click menu item 3 –2ページをクリックする
end tell
end tell
end tell
end tell
Leave a comment
記事投稿日
日 | 月 | 火 | 水 | 木 | 金 | 土 |
---|---|---|---|---|---|---|
« 9月 | ||||||
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |