Which is XnviewMP syntax to use "path" of selected file in a "parameter" (configure programs):

Ask for help and post your question on how to use XnView MP.

Moderators: helmut, XnTriq, xnview

Post Reply
cadu
Posts: 114
Joined: Thu Mar 15, 2012 10:43 am

Which is XnviewMP syntax to use "path" of selected file in a "parameter" (configure programs):

Post by cadu »

Hi,

I would appreciate help.

In order a parameter (configure programs) can work, I need to insert the "file path" of the selected file in XnView browser.

The main parameter is "-ImageEditor", but I need to add a "file path" prefix to it, as showed in this snapshot:
xnviewmp_2018-07-03_14-21-35.png
xnviewmp_2018-07-03_14-21-35.png (19.84 KiB) Viewed 2583 times

As fictional example (since %FILEPATHS% doesn't work in XnView), what I need is something like: "%FILEPATHS% -ImageEditor"

Which is XnviewMP syntax to use "path" of selected file in a "parameter"?

Thanks for assistance,
Carlos
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Which is XnviewMP syntax to use "path" of selected file in a "parameter" (configure programs):

Post by xnview »

currently the full pathname of file is used as argument, so no way to add path of this file
Pierre.
stevehero
Posts: 77
Joined: Fri Feb 12, 2021 9:17 pm

Re: Which is XnviewMP syntax to use "path" of selected file in a "parameter" (configure programs):

Post by stevehero »

I got this working with:

Code: Select all

-ImageEditor %1
Image

ED: Only noticed this only works with one file selected.
User avatar
Patrice.
Posts: 27
Joined: Sun Feb 25, 2018 1:35 am
Contact:

Re: Which is XnviewMP syntax to use "path" of selected file in a "parameter" (configure programs):

Post by Patrice. »

stevehero wrote: Fri Feb 12, 2021 10:15 pm I got this working with:

Code: Select all

-ImageEditor %1
ED: Only noticed this only works with one file selected.
Try

Code: Select all

-ImageEditor %U
it should work with multiple selected images, it works like a charm for me (Ok, I'm on Linux but you can try it with a test directory)
screenshot_20210305-122801.png
screenshot_20210305-122801.png (27.6 KiB) Viewed 1951 times
stevehero
Posts: 77
Joined: Fri Feb 12, 2021 9:17 pm

Re: Which is XnviewMP syntax to use "path" of selected file in a "parameter" (configure programs):

Post by stevehero »

Unfortunately, that didn't work for this case. It was trying to upload them too.
I had help on another similar thread and I'm now using a .bat file.

Code: Select all

:bb
if %1==z goto end
"W:\Apps (Portable)\Screen Capture Apps\ShareX\ShareX.exe" -ImageEditor %1
shift
goto bb
:end
exit
User avatar
Patrice.
Posts: 27
Joined: Sun Feb 25, 2018 1:35 am
Contact:

Re: Which is XnviewMP syntax to use "path" of selected file in a "parameter" (configure programs):

Post by Patrice. »

last suggestion, did you try: -ImageEditor "%1" (with double quotes " ", In a different forum I saw many Windows users are using " " in parameter, I'm not a Windows user though, so I don't know) or call directly the app by its file name the same way: ShareX.exe "%1" (with or without the - )

In all case I'm glad you've found a solution :D
Last edited by Patrice. on Sat Mar 06, 2021 3:15 am, edited 2 times in total.
stevehero
Posts: 77
Joined: Fri Feb 12, 2021 9:17 pm

Re: Which is XnviewMP syntax to use "path" of selected file in a "parameter" (configure programs):

Post by stevehero »

I did try that. Double quoting didn't have any affect.
User avatar
Patrice.
Posts: 27
Joined: Sun Feb 25, 2018 1:35 am
Contact:

Re: Which is XnviewMP syntax to use "path" of selected file in a "parameter" (configure programs):

Post by Patrice. »

Did you tried to see what's the exact command in your Microsoft Windows main menu (the main app launcher in the Windows OS something like Start button then Programs/...) with a right click on the name of the application (here ShareX) then "properties" or with a menu editor?

A bit like this (sorry it's the Linux "Main menu editor", but you should have something similar on your system)
screenshot_20210306-111057.png
stevehero
Posts: 77
Joined: Fri Feb 12, 2021 9:17 pm

Re: Which is XnviewMP syntax to use "path" of selected file in a "parameter" (configure programs):

Post by stevehero »

I'm not sure where %U comes into play in windows.

Here's the command line argument that's used for Windows.

Code: Select all

"C:\Program Files\ShareX\ShareX.exe" -ImageEditor "%1"
Source: https://github.com/ShareX/ShareX/issues ... -258318864
User avatar
Patrice.
Posts: 27
Joined: Sun Feb 25, 2018 1:35 am
Contact:

Re: Which is XnviewMP syntax to use "path" of selected file in a "parameter" (configure programs):

Post by Patrice. »

So no choice, for Windows it's "%1"
I saw on the gihub link you provided some one did put "-ImageEditor (filename)" instead of "-ImageEditor %1" did you tried it to open multiple images?
stevehero
Posts: 77
Joined: Fri Feb 12, 2021 9:17 pm

Re: Which is XnviewMP syntax to use "path" of selected file in a "parameter" (configure programs):

Post by stevehero »

That was me that posted that. That was for faststone image viewer. Doesn't work for this app.
Post Reply