Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Running AppleScripts without a display' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Running AppleScripts without a display
Authored by: floop on Dec 23, '03 01:09:04AM

I really should do a little more research before giving my opinion but since no one else is...I too ran into this problem a while back. It does not seem possible to run AppleScripts from a user that it not the current user. Just try running osascript in the terminal when logged in as another user. You will get a message that includes "initCGDisplayState: cannot map display interlocks." This is under 10.2.8 and previous systems. Perhaps Panther is different, but it seems AppleScript must have a display to execute.

Also, Apple's page on using AppleScript as CGI's only seems to apply to OS X Server and <= System 9. It just would never work for me on standard OS X because of the display problem.

So there is a little more security risk running Apache as the current user. Security is a personal decision and the amount you need should be weighed against what is being protected. The only reason I stopped using this method was not security but rather that different users shared my machine and the AppleScripts would not work as soon as I logged out.

Does anyone know how to avoid the "initCGDisplayState: cannot map display interlocks." problem when running osascript from a user that doesn't have a display such as the www user?



[ Reply to This | # ]