We have two signed Mac OS X apps (that we developed — non "app store" apps). appA runs an Applescript (from a .scpt file) that sends appB a message to launch and search for some text.
This works perfectly on OS X 10.6.
On OS X 10.7 and 10.8, I get a different behavior: when appA runs the Applescript, appB WILL NOT LAUNCH. However, if appB is ALREADY RUNNING, then appA's message IS received by appB and the requested search is processed.
This seems like a sandbox issue: when we issued this command to Terminal:
sudo spctl --master-disable
…and restart, there is also no problem with the Applescript launching appB on 10.8. On 10.7, appB will still not launch.
Do we need TEMPORARY ENTITLEMENTS to be able to execute an AppleScript script (or send AppleEvents) to our other app? Both apps are manually signed using codesign. Are these entitlements obtained from Developer Relations and applied with codesign?
appA gets the AppleScript and executes it through the following functions:
OpenDefaultComponent(), OSALoad(), AEBuildAppleEvent(), OSAExecuteEvent()
The AppleScript being executed is:
on lookup(search_phrase)
tell application "appB"
activate
lookup (search_phrase)
end tell
end lookup
property ASDScriptUniqueIdentifier : "Lookup.scpt"