LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Link to application (https://www.linuxquestions.org/questions/linux-software-2/link-to-application-28385/)

breany 08-20-2002 06:49 PM

Link to application
 
Creating a "Link to application" (Mandrake 8.2), we enter the command in the "Execute" panel. The app I want to execute - XPDF - requires a filename as a parameter, to know which file to open. (The program doesn't seem to have an "Open file" panel that will let you search for, and select, an input file to be loaded once the app has started). Is there a parameter that I can enter after the "xpdf" command that will open such a file selection box, and pass the selected filename to the OPEN of XPDF?

Thanks in advance;


"BEER; the only reason to get up every afternoon"

MasterC 08-21-2002 04:42 AM

breany, are you saying that the program 'xpdf' doesn't have an "open" command? If so, it does. I just tried it. You have to "right click" or type "o" to get it to come up.

HTH

Cool

trickykid 08-21-2002 05:00 AM

Yeah, xpdf works like The Gimp, you right click to pull up the menu to open files and such.. save... etc.
So creating a link to the program itself would make more sense, instead of creating a link to a specific file to open everytime.

breany 08-21-2002 07:43 AM

Thanks - I hadn't seen that option. it takes care of the immediate problem - but leaves the original question unanswered.

If I want a desktop link to a program, and that program requires the user to enter a filename as a parameter (I.E., "xpdf $HOME/selected_file.pdf"), how would I allow the user that clicks on the link to select the name of the target file that would be passed to the xpdf command, when it is finally executed?

Let's see - -

The link's EXECUTE panel would have the name of a script for xpdf function. That script would call an existing routine that opens a window which lets the user find and select any file that they choose, returning the name of the full pathname of the file to the script. the script then invokes xpdf with the parameter of the name returned.

OK, that should work.

Now, we have 2 functions.

First is "Find a filename, and return it". This is graphikal, on the desktop. It passes the full pathname of the desired target file back to our script as a variable "targetname".

Second is "xpdf ${targetname}".

The second part is already coded, - and I've seen the first part in apps that I've worked with before. Since I hate inconsistancy in a platform's operating environment , I should try to find the name of a desktop script for an existing routine that does this.

Is there someplace in the Mandrake system (short of the KDE source code) where I could look up such a routine? If there isn't, does anyone know what the routine used by KDE is called?

Thanks again.

MasterC 08-21-2002 10:02 AM

Whoa! You wanna do what to who and where? If you are speaking of possibly making a symlink to a file on your desktop and making xpdf open the file when you click the symlink, you could simply associate all .pdf files with that application. I am too newb to actually write code, so I can't give you the exact answer to your question, but this would be how I would do it.

You can set the program to open .pdf files in the KDE Control Panel. Go to File Browsing, then to File Associations. Scroll through the list until you come upon .pdf (Mine is in Application in Slack 8.1 KDE3), then put xpdf to the top of the application list. Now if you make a symlink to a .pdf file in your filesystem, onto your desktop, it will open, and open with xpdf.

Does this help at all?

breany 08-21-2002 12:58 PM

It's a second work-around - and actually better than my proposed solution.
Thanks!!!

MasterC 08-21-2002 09:03 PM

Sweet, glad I could be of some help, but I am still ashamed i do not know any scripting.

But, you're welcome ;)


All times are GMT -5. The time now is 06:34 PM.