0

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.

enter image description here

Tim
  • 25,177

1 Answers1

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
  • Thanks. %u works. Why doesn't %f work? The files are on the local machine, so I guessed %f should work? URI can mean local or remote files, so %u should work for local and remote files? – Tim Jun 13 '17 at 17:05
  • @Tim %f is 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:06
  • Thanks. It seems that I can't set "Application name" to be PDFXCview.exe for 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:17
  • @Tim Set the Application name to be different? Maybe just PDFXCview or something? If you've already created an application name you need to find its launcher and edit that. That'll be a bit harder to find unfortunately... – Thomas Ward Jun 13 '17 at 17:19
  • I have set to PDFXCview too. How can I find their launchers and edit them? – Tim Jun 13 '17 at 17:23