This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Import CCS path variable in Scripting Console

Hello,

Is it possible to import a path variable inside the CCS Scripting Console ?

I need the absolute path to the Workspace directory in my JavaScript, and I could only find the command env.getCurrentDirectory(), which returns the path to the Eclipse folder, and the command java.lang.System.getenv("${PARENT_LOC}") which returns null.

Thanks for support.

  • HI Armel,

    I am not aware of a quick way to find out the workspace directory, however you can use eclipse's API to find out the workspace directory. Here is the sample script:

    importPackage(Packages.org.eclipse.core.runtime);
    var l = Platform.getInstanceLocation();
    var f = FileLocator.toFileURL(l.getURL());
    print(new Path(f.getPath()));

    Regards,
    Patrick