Comment 3 for bug 1445667

Revision history for this message
RaiMan (raimund-hocke) wrote : Re: [1.1.0] OS X 10.10.3: App.open("Mail") doesn't work anymore --- specific Mac problem --- workaround

I added some support for inline run of AppleScript snippets, which might help in such situations.

In this case, this works to open Mail:

# version to run a multiline AppleScript script
cmd = """
applescript
tell application "Mail" to activate
display alert "Mail should have started"
"""
if 0 != runScript(cmd):
  popup("did not work\nsee error message")
  exit(1)

wait(3); App.close("Mail"); wait(3)

# version to run a one-line AppleScript script
if 0 != runScript('applescript tell application "Mail" to activate'):
  popup("did not work\nsee error message")

# to get the textual output of the command
textResult = RunTime.get().getLastCommandResult()