Problems with using osascript for remote rendering via pvsc

In an effort to be more friendly to some of our mac users we are attempting to switch over from using xterm, which is not installed by default, to using apple script via osascript to launch the server via a pvsc file. However, osascript is extremely sensitive to double quotes and absolutely needs certain items wrapped in double quotes. As an example, the following (semi-redacted) command works from my terminal:

osascript -e 'tell app "Terminal" to do script "/usr/bin/ssh myself@someserver -tR 37940:localhost:37940 /opt/paraview/run-pvserver.sh 5.8.0 1 37940"'

Note that the two sets of double quotes are absolutely critical and I cannot figure out how to get paraview to send double-quoted text to my command. I’m aware of using " to escape double quotes in xml and have done so in the pvsc file but it seems the quotes are still being stripped off the final command sent to the shell since I’m getting osascript syntax errors.

To facilitate more rapid experimentation, I’ve been entering the desired text directly in the Execute an external command to start the server box that appears in the gui when one clicks Edit Server-> Configure. Entering the exact same text that works in my shell causes osascript syntax errors when entered directly as an external command in that box so something sneaky is happening.

Is there anyway to stop paraview from stripping away my very essential " from the command? I’ve tried obvious things like backslash but that hasn’t worked.

I’m using Paraview 5.8. Please let me know if any more information is needed.

Thanks.

I can’t directly help you with osescript, but looking at your script, it looks like you’re trying to setup a ssh connection.

ParaView support SSH connection directly using Terminal app on Mac.

See there for usage :

Thank you for the link. Unfortunately that only deals with xterm which does not require the same level of quoting as osascript. If xterm is the only way for this to work than that’s what we will continue to use. We are trying to use mac-native programs so that the users do not need to install and run and programs in addition to paraview. The only native tool we’ve found that can do that (i.e. start up a native mac terminal and send it commands) is osascript.

Note that our problem is not really using osascript. We know how to use it. The problem is that paraview is removing the double quotes from whatever string it is sending to the shell to execute osascript.

Is there are way to keep paraview from stripping off my double quotes?

This ParaView feature uses the Terminal OSX App, not xterm.
https://gitlab.kitware.com/paraview/paraview/-/blob/101ce468a282c8162e52fde6d453ecc0c3a43c57/Qt/Core/pqServerConfiguration.cxx#L472

Thank you! I’ll try to fiddle with our pvsc file to get this to work. Do you know of any examples of pvsc files that use this mac native feature?

The idea of this feature is that it’s use is transparent to use on any OS.
See the first example and associated files in the first link.

Just to make sure I understand (since the example pvsc file is structured quite differently from what I’m used to), the key to native terminal support is the empty element: <Terminal/>?

Thanks for your patience.

the <Terminal/> key means that ParaView will try to find a native terminal on your system, whichever it is. On MacOS, it will always be the Terminal App unless specified otherwise.

Great! This should simplify our pvsc file quite a bit.

That is the point of this feature.