SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Topic started by: gsexton on November 01, 2017, 09:39:13 pm

Title: Adding Tools To Project
Post by: gsexton on November 01, 2017, 09:39:13 pm
I've been adding my own tools to the Project menu by editing the VPJ file. For example:


<Target
    Name="PMD File"
    MenuCaption="&amp;PMD File"
    RunFromDir="%rw"
    CaptureOutputWith="ProcessBuffer"
    SaveOption="SaveCurrent">
    <Exec CmdLine="ant pmdfile -Dpmd.target.file=%f"/>
</Target>


Now I'd like to add another tool. To call this tool, I need a relative path to the file that I'm editing minus the extension.

so say I'm editing:

/home/myname/project/src/com/mycompany/myapp/File.java,

I need to extract out as an argument:

com/mycompany/myapp/File

I've looked at the help and see various escape codes, but I need to do a replace to clean up the path. Are there ways I can invoke Slick-C functions? Do functions I need exist?

Can anyone point me in the right direction to get started?

Title: Re: Adding Tools To Project
Post by: Clark on November 02, 2017, 07:02:36 pm
I tried this:

echo   %(last-path-part 3 %f)/%(last-path-part 2 %f)/%(last-path-part 1 %f)/%n

Hope this helps.