Groovy scripts by Yu Tang, included in the recent version of the Scripting Plugin, are geared for Windows and need manual editing to be usable on other systems.
I suggest adding a little OS check in them to make them cross-platform.
It can be done (with my zero-knowledge of Java) with
System.getProperty("os.name");
So with an "if, then" check these scripts can behave according to the system they are run on.
In Linux opening files and folders can be done with "xdg-open" (regardless of DE), in OSX it's "open", I believe.
Scripts are updated. Also I tried to write in more groovy way.
I tested only under Windows 7.
Anybody try them on Mac or/and Linux?
I have committed the updated scripts to the Git repository.
I won't publish the script plugin with the update, because it will be integrated in OmegaT anyway.
Didier
Last edit: Didier Briel 2013-05-22
In Linux using escaped quotes in command (like in --->command = "xdg-open \"folder\""<---, for instance) are passed literally, as a part of filename, and thus opening fails. Without quotes works as expected.
If the project's path contains a space, the command fails with or without quotes. Although, when the path has spaces and escaped quotes are used, then xdg-open receives quotes as a part of the path, but the path is truncated right before the first space. For instance, if my project's folder is "/home/user/Documents/Urgent projects/EN-RU/May 20-26, 2013", xdg-open gives me this error:
Unable to detect the URI-scheme of ""home/user/Documents/Urgent".
(Two quotes at the beginning, one quote at the end, but I suspect the final quote got swallowed because of the space).
In previous version of the scripts any path could be open, no matter how many spaces there were.
The scripts were updated and should now work on all platforms.
I have also updated them in the Git repository of the plugin (for 2.6).
Didier
Implemented in released version 3.0.3.
Didier