nppexec Issue with npp_switch()



  • Hi,

    I try to do this:
    set current = $(FULL_CURRENT_PATH)
    npp_switch($(#1))
    npp_switch($(current))
    unset current

    And got this in the console where <pathtofile> is a real path (the file is here):
    SET: current = new 4
    $(CURRENT) = new 4
    npp_switch(<pathtofile>\pdfdocument.class.php)
    CreateProcess() failed with error code 2:
    Le fichier spécifié est introuvable.

    npp_switch(new 4)
    CreateProcess() failed with error code 2:
    Le fichier spécifié est introuvable.

    -the user’s variable has been removed: $(CURRENT)
    ================ READY ================

    Any idea why?
    Thanks.



  • Hello @T0mate,

    to many round brackets ;-)

    This should do the trick

    set current = $(FULL_CURRENT_PATH)
    npp_switch $(#1)
    npp_switch $(current)
    unset current
    

    Cheers
    Claudia



  • Thanks it works.
    I have an other question can I do something like that:
    set N = 1
    $(#$(N))

    ?



  • I have a last question can I configure nppexec to execute a script when I open a new file?
    I know I can when n++ start but it’s not executed when it’s already started and I choose to open a new file.



  • Unfortunattely both answers are: afaik no.
    Neither docs nor internal help indicate something different.

    Cheers
    Claudia



  • Thanks for your help.


Log in to reply