Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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).

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer

Xvfb is not "Linux's", it's X11.

Mac OS X includes X11 support, called XQuartz (aka X11.app), installed with the system by default since version 10.5. It includes Xvfb (/usr/X11/bin/xvfb).

EDIT: Now, that you explained better what you need, it's more clear. What you want is headless setup, to run GUI apps on that you need to either setup VNC server or use Apple Remote Desktop.

share|improve this answer
    
You're right, I haven't explained myself correctly. Anyway, I think this won't really help - the problem is that there must be a user logged in with UI (i.e., not using ssh), otherwise the script fails. And X11 won't allow me to run finder or will it? –  Tomas Brambora Feb 23 '11 at 10:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.