Highlight Files in X and get some function executed, how?

view full story

http://unix.stackexchange.com – Suppose I want to execute pdftk input FilesHighlightedInX out specifiedByUserInX in the following way: User highlights files in X User clicks some button, shortcut, right-mouse-button-select, to execute a Bash script with the pdftk command The output file will appear in the directory where user executed the command (user can specify the name of the output or not, modular functionality) How can I do this in X? (HowTos)