I'm in a real hurry so every working solution seems to be fine with me :-) I found the test automation tool xdotool which enabled me to send Return keypress to the window. There were problems getting the window id, but this script finally did the trick. #!/bin/sh gimp -i -b "(script-fu-quick-print \"$1\")" -b "(gimp-quit 0)" & xdotool search --sync --class print xdotool search --onlyvisible --name Print | xargs -I {} -n 1 xdotool key --window {} Return This is quite ugly, but it works, and now I can move forward. -Niklas On Thu, Jul 31, 2014 at 4:58 PM, Niklas Koponen <niklas.koponen@xxxxxx> wrote: > Oops... The second procedure call should be > > (file-print-gtk RUN-NONINTERACTIVE image) > > The main reason that I don't want the print dialog to appear is that it > shows too many possibilities to mess the system up. As mentioned, it is > going to be a photobooth, and there should be only the three buttons > visible, which my application provides. They are 'Take photo', 'Print > photo', 'Clear photo'. > > The whole script looks like this: > > (define (script-fu-quick-print inImage) > (let* ( > (image (car(gimp-file-load RUN-NONINTERACTIVE inImage inImage))) > ) > (file-print-gtk RUN-INTERACTIVE image) > (gimp-image-delete image) > ) > ) > (script-fu-register > "script-fu-quick-print" > "Quick Print" > "Prints non interactively" > "Nikkez" > "Copyright 2014" > "July 2014" > "" > SF-FILENAME "Input file" "./Projects/photobooth/testimage.jpg" > ) > (script-fu-menu-register "script-fu-quick-print" "<Image>/File/Quick > print") > > > > > On Thu, Jul 31, 2014 at 2:15 PM, Niklas Koponen <niklas.koponen@xxxxxx> > wrote: > >> Hi! >> >> I'm having the following problem. I'm trying to print images non >> interactively from a photobooth application I have written. It is a quick >> and not so dirty solution written in python. It captures the images using >> 'fswebcam' and the original plan was to print the images using 'lpr'. The >> printer used is a HP Photosmart Premium 309. It is impossible to get images >> to print right using lpr. I noticed that using 'eog' the images seemed to >> be printing ok, so I suspected that gtk printing might work. That led me to >> gimp, because I knew that there was a non-interactive mechanism to run >> scripts. The printing also works fine from gimp when done interactively >> from the menu. >> >> Now to the problem with the file-print-gtk procedure. If I run the >> file-print-gtk procedure like this >> >> (file-print-gtk RUN-INTERACTIVE image) >> >> and press just the OK button, everything prints nicely. >> >> If I run the procedure like this >> >> (file-print-gtk RUN-INTERACTIVE image) >> >> >> the image is printed on the photo paper presumably 2 times larger, so >> that only one quarter of the image is printed on the paper. >> >> I'm a bit confused about what settings are used when the print page setup >> dialog is shown, and what settings are used when the dialog is not shown. >> That seems to be obvious that they are different settings. >> >> I read from this thread >> http://www.gimpusers.com/forums/gimp-user/11146-printing-from-a-batch >> that one might try to change the parameters in files print-settings and >> print-page-setup which are located in the gimp user directory. The problem >> is that I have no idea when these files are used, interactively on >> non-interactively. >> >> There was also a mentioning about file-print-gtk-page-setup procedure. >> What does this do? >> >> Any help is appreciated. The photobooth application needs to be ready in >> a week, and the printing part is the only thing missing. I would not be >> proud of a solution where the user sees a print dialog and has to press OK. >> I want to be able to do the printing with only one push of a button. >> >> -Niklas >> > > _______________________________________________ gimp-developer-list mailing list List address: gimp-developer-list@xxxxxxxxx List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list List archives: https://mail.gnome.org/archives/gimp-developer-list