I tried to add a program run under Wine as an option to open files of a certain type (here pdf files), as following. But when I choose the option after right clicking a pdf file, the program runs without opening the file. Did I add the option correctly? Thanks.
Asked
Active
Viewed 243 times
1 Answers
1
You need to add %u or %U (probably the uppercase one) to the end of the command as an argument - that passes in the URI of the file to open so it knows what file to read. See the little text blurb above the command line you're editing.
So if my executable was foo.exe and my file was in /tmp/blah.txt, then the %U argument would end up being /tmp/blah.txt and the system would execute foo.exe /tmp/blah.txt instead of just launching foo and opening the application and not the file.
A warning: You might need to make this wine /path/to/PDFXCview.exe %U if it doesn't load up normally - sometimes executing inside of Wine works when it otherwise wouldn't.
Thomas Ward
- 74,764

%uworks. Why doesn't%fwork? The files are on the local machine, so I guessed%fshould work? URI can mean local or remote files, so%ushould work for local and remote files? – Tim Jun 13 '17 at 17:05%fis just the file name - not the full path on disk. One should always use the full URI path when passing things to a launcher command for accessing the files, because otherwise it might look in the wrong locations. Remember: absolute paths are better than relative ones, and the full URI is the absolute path normally. – Thomas Ward Jun 13 '17 at 17:06PDFXCview.exefor association, because the application name exists already from my previous command line without%u. How can i remove it and start over again? – Tim Jun 13 '17 at 17:17PDFXCviewtoo. How can I find their launchers and edit them? – Tim Jun 13 '17 at 17:23