Author Topic: Adding Tools To Project  (Read 592 times)

gsexton

  • Community Member
  • Posts: 21
  • Hero Points: 0
Adding Tools To Project
« 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?


Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4893
  • Hero Points: 398
Re: Adding Tools To Project
« Reply #1 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.