I am also confused.

I am pretty positive that you cannot make (very easily) a GUI program give
you a string of the filename (with full path) of a file that it has opened.
But if you made the program open that file using the command line, you
already have that string, and you may have to play some tricks with shell
variables, etc, to fully construct it.

If your GUI program was launched somehow, say by clicking on a PDF link in
the browser, you are most likely out of luck.

I think that your question is not well formed/posed.