applescript 実行するとsystem eventsでエラーとなる
mac OS High Sierra(10.13) で webに出ていたapplescriptを参考にしてapplescript を実行すると 以下のerrorで
動作しません。全くの素人のため 修正の方法もわからずに困ってしまいました。
解決策教えていただけないでしょうか。記事の内容は googleのブックマークをsafariに自動的に反映させる方法
tell application "Safari"
active
tell application "System Events"
tell application "System Events"
tell process "Safari"
tell menu bar 1
tell menu bar item "ファイル"
tell menu "ファイル"
tell menu item "読み込む"
tell menu "読み込む"
click menu item "Google Chrome..."
delay 0.5
keystroke return
end tell
end tell
end tell
end tell
end tell
end tell
end tell
end tell
end tell
実行すると
error "System Eventsでエラーが起きました: menu item \"Google Chrome...\" of menu \"読み込む\" of menu item \"読み込む\" of menu \"ファイル\" of menu bar item \"ファイル\" of menu bar 1 of process \"Safari\"を取り出すことはできません。" number -1728 from menu item "Google Chrome..." of menu "読み込む" of menu item "読み込む"of menu "ファイル" of menu bar item "ファイル" of menu bar 1 of process "Safari"
iMac (Retina 5K, 27-inch, Late 2015), macOS Sierra (10.12)