User-defined commands @filesfromdroponly

Hello,

I have a User-defined command called app_Notepad++ that points to notepad++.exe, I then created a toolbar button and its function looks like this:

@filesfromdroponly app_Notepad++ "%1"

What I want is, if I click the button to run notepad++.exe without arguments, but if I drop files on the button then open them in notepad++.exe.

That doesn't work, clicking the button (not dropping) always passes selected files to "app_Notepad++".
If I edit the button and instead of app_Notepad++ "%1" I point directly to notepad++.exe like this "/home....\Notepad++\notepad++.exe" "%1" works.

Any idea?
Thanks

It seems adding @filesfromdroponly to User-defined command takes care of this issue, so having @filesfromdroponly in buttons in this case has no effect.
Am I right?

You may need it on the user-command, or both, yes.

But you don't really need a user command for this at all. Instead, create a /notepad++ alias (Preferences / Favorites and Recent / Folder Aliases) that points to the folder the program is in (/home....\Notepad++ in your case), then use this in the main button:

(It's also better to use {filepath} instead of "%1" for an optional filepath, since you don't want to pass "" if the path is empty.)

@filesfromdroponly /notepad++\Notepad++.exe {filepath}

The aliases UI also makes editing the path easier should you need to change it.

Thanks leo :slight_smile: