Clipboard question again

I am using my laptop and Timbuktu to connect to the machine that has eggplant on it. And in turn the eggplant machine uses VNC to connect to the SUT. Both systems are running Mac OS X 10.3.9.

I want to capture a text based code off a web page/screen and place it into a file (as a log). I can locate the text, double click it, and TypeCommand "c" (to copy it) just fine. But the remoteClipboard() doesn't work. It gives me this error: pasteboard inaccessible on remote machine

I've read this forum topic:

I do not want to have to capture the screen (or portion of) as an image to manually check later. I need to grab the text code and put it into a file because another script will read each one and verify if the text code is in the database. There will be too many to do by manual means.

I did find the following in the manual but don't really understand it. Can some translate it into easy to understand terms:

Note: On Mac OS X systems, the VNC server can only access the clipboard when it is running as the current user. This can be accomplished by launching OSXvnc manually after login or by setting up OSXvnc to run as a login (startup) item in the ?Users? panel of the System Preferences. The ?Startup Item? that can be created from within the OSXvnc application itself is launched at system startup and runs as the ?root? user, so it does not have access to the clipboard. This is a restriction that is imposed by the OS.

Any suggestions?

Thanks in advance for the help.


  • SenseTalkDougSenseTalkDoug ForumAdmin admin
    There are basically two ways the OSXvnc server can be started up on the SUT. If it is started by a user after they log in on the SUT (or as an item that is started automatically when they log in) then the server will have access to the clipboard contents for that user.

    If, on the other hand, the OSXvnc server is launched automatically when the machine is booted, so that it is running before anyone is logged in, that server will not have access to the clipboard, even after a user logs in. This is a restriction that is imposed by the Mac OSX operating system (for security reasons), with no direct way to work around it as far as we know.

    The current versions of Eggplant and OSXvnc are able to detect this condition, and throw the "Pasteboard inaccessible on remote machine" error when you try to access the remoteClipboard() function, so your script can recognize the problem and take any necessary actions.

    I said there was no direct workaround to the problem, but there is an indirect way around it that may provide a solution. While you are connected to the SUT through a boot-time server that can't access the clipboard, you can log in as the desired user and start another OSXvnc server running on the same machine. Assign it to run on a different port number than the first server. Then, connect to that second server and you should have access to the clipboard.

    You can even script this entire process in Eggplant: logging in, starting a second VNC server, and switching Eggplant's connection to the new server. If your script includes logging out, the second server will be shut down so Eggplant will lose the connection, and your script will have to switch back to the original connection, but this approach should allow a script to log in and out as different users while maintaining access to each user's clipboard.
  • I am getting not the error you mention "Pasteboard inaccessible on remote machine" but "No remote clipboard could be got in 10 secs". Are they essentially same or a cause and effect thing
  • Can you put the technique of the workaround you have mentioned in an example or script
Sign In or Register to comment.