Avoid AppleScript command errors when used via SSH

Nov 10, '04 07:56:00AM

Contributed by: MartySells

I finally figured out why I wasn't able to run AppleScript commands when I SSHed into one of my systems. Here's what I was seeing:

$ say hello
Bus error
$ osascript -e 'say hello'
CFMessagePortCreateLocal failed (name = Processes-0.20971521 error = 0)
Abort trap
At first, I thought this had to do with user security, but they still failed when putting sudo in front of them. Doing some reading, I figured out that this has to do with process groups. You can only run AppleScript if your process is in the same group as the user logged onto the console. In my case, I was trying to run the AppleScript from within a screen session, and screen somehow creates its own process group(s).

Accordingly, run the AppleScript commands from outside screen, and it all works. Took me ages to figure this out...

Comments (5)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20041108203936381