the file /Users/raimundhocke/astest.txt contains the AppleScript command:
tell application "Mail" to activate
using the direct osascript -e script mode does not work and returns the error -10810 (not documented)
cmd = ['osascript', '-e', 'tell application "Mail" to activate']
BTW: does not work either for any not open (Apple) application (like Safari, Calculator, ...)
... but Google Chrome opens
tested some variants - this is the only that worked:
cmd = ['osascript', '/Users/ raimundhocke/ astest. txt']
print run(cmd)
the file /Users/ raimundhocke/ astest. txt contains the AppleScript command:
tell application "Mail" to activate
using the direct osascript -e script mode does not work and returns the error -10810 (not documented)
cmd = ['osascript', '-e', 'tell application "Mail" to activate']
BTW: does not work either for any not open (Apple) application (like Safari, Calculator, ...)
... but Google Chrome opens