When I add a button to the toolbar, is there any tokens to use if I want to specify a parameter?
For example, say I add a button for my program. I want to put something like this in the toolbar button's command box.
myprogram.exe -param1 %selectedfile%
I think what happens right now is that the selected files get sent as commandline parameters, but I don't see any way to modify the commandline to add my own switches.
Toolbar Button Parameters
Moderators: XnTriq, helmut, xnview
-
- Posts: 286
- Joined: Thu Aug 23, 2007 2:33 pm
- Location: United States
-
- Author of XnView
- Posts: 45218
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
Re: Toolbar Button Parameters
In .bar file, you can use
Code: Select all
button1=icon_filename
cmd1=cmd_string
Pierre.
-
- Posts: 286
- Joined: Thu Aug 23, 2007 2:33 pm
- Location: United States
Re: Toolbar Button Parameters
Thanks, Mr. XnView.
So, for cmd_string, should I use %1 to indicate the file like I would in Explorer? I understand I can specify the commandline, but how do I pass the filename?
So, for cmd_string, should I use %1 to indicate the file like I would in Explorer? I understand I can specify the commandline, but how do I pass the filename?
-
- Author of XnView
- Posts: 45218
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
-
- Posts: 286
- Joined: Thu Aug 23, 2007 2:33 pm
- Location: United States
Re: Toolbar Button Parameters
Pierre,
It doesn't seem to work if I add a switch.
If I do not add any parameters or switches, it works fine:
button1=c:\myprogram.exe
cmd1=c:\myprogram.exe
The app receives the passed filename
If I do this, it does not works:
button1=c:\myprogram.exe
cmd1=c:\myprogram.exe -aparameter
Nothing happens, although it works if I do it via commandline myself
But if there were a variable/token to indicate to indicate a placeholder for the filename, then I could work on mutliple selections.
Here is what I want to be able to do:
button1=c:\myprogram.exe
cmd1=c:\myprogram.exe -aparameter %path1% %path2%
It doesn't seem to work if I add a switch.
If I do not add any parameters or switches, it works fine:
button1=c:\myprogram.exe
cmd1=c:\myprogram.exe
The app receives the passed filename
If I do this, it does not works:
button1=c:\myprogram.exe
cmd1=c:\myprogram.exe -aparameter
Nothing happens, although it works if I do it via commandline myself
But if there were a variable/token to indicate to indicate a placeholder for the filename, then I could work on mutliple selections.
Here is what I want to be able to do:
button1=c:\myprogram.exe
cmd1=c:\myprogram.exe -aparameter %path1% %path2%
-
- Author of XnView
- Posts: 45218
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
-
- Posts: 286
- Joined: Thu Aug 23, 2007 2:33 pm
- Location: United States
Re: Toolbar Button Parameters
Pierre,
Ah, okay. That's what I was guessing. Thanks for answering and confirming that.
Ah, okay. That's what I was guessing. Thanks for answering and confirming that.
-
- Posts: 286
- Joined: Thu Aug 23, 2007 2:33 pm
- Location: United States
Re: Toolbar Button Parameters
Pierre,
Is this fixed yet, perhaps? I am dreaming of being able to specify parameters to custom toolbar buttons.
Basically, I have some autohotkey scripts I want to run on the files by selecting them and pushing the toolbar button. But I need to supply the filename or filename's directory path as parameters to my scripts. So, I am rather still seeking to do what I did the last time I posted.
I have this one script that creates a text file where I store information, but I need to specify the directory path as a parameter to my script...
As things are, the only thing that seems to be sent is the filename if a file is selected.
But I'm needing a token for the current-folder-path.
Is this fixed yet, perhaps? I am dreaming of being able to specify parameters to custom toolbar buttons.
Basically, I have some autohotkey scripts I want to run on the files by selecting them and pushing the toolbar button. But I need to supply the filename or filename's directory path as parameters to my scripts. So, I am rather still seeking to do what I did the last time I posted.
I have this one script that creates a text file where I store information, but I need to specify the directory path as a parameter to my script...
As things are, the only thing that seems to be sent is the filename if a file is selected.
But I'm needing a token for the current-folder-path.