I use code like this to do some menu clicks automatically instead of doing them myself every time again:
tell application "System Events" to tell process "myApp"
click something and so on
end tell
Now, to make this work in the osx lion sandbox, my entitlements file looks like this (done a lot of research to figure this out):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.temporary-exception.apple-events</key>
<array>
<string>com.apple.systemevents</string>
<string>com.apple.iphonesimulator</string>
</array>
</dict>
</plist>
And now, as god wants, apple rejects this app because I am accessing com.apple.systemevents
. Is there any way to workaround using System Events
to click specified menu items in the menu of a specified app?