Xvfb alternative for Mac server

mac-osx-server

I need to run an applescript that uses Finder; however, I have to run it as a user connected via ssh. So there's no UI. And the script fails with -10810 error when there's no UI.

Is there any alternative for X11's Xvfb that I could use for Mac server 10.6 to fake a display and make the script work?

Cheers!

Tomas

Edit: To explain the problem more precisely – the script works if there's a user logged in with UI (e.g., when the user that uses ssh to run the script is also logged in via VNC). However, when I only log in using ssh, the error appears. Which leads me to believe that the script needs UI to be able to use Finder.

So I guess running X11 and Xvfb on the server won't really help, because it won't allow me to run the script anyway (I need to start Finder).

Best Answer

It's not just the Finder, AppleScript is really intended to control programs running within an Aqua UI session; trying to use it from a pure command-line environment (or even X11) seems doomed to failure. If you're in a command-line environment, I'd use a shell script if at all possible -- there are commands available to do pretty much anything the Finder can do.