diff --git a/Scripts/Nautilus/.prompt-output.py b/Scripts/Nautilus/.prompt-output.py new file mode 100755 index 0000000..ce94e38 --- /dev/null +++ b/Scripts/Nautilus/.prompt-output.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python + +# Helper Script to ask for the output file name +# John Ryland + +import pygtk +pygtk.require('2.0') +import gtk + +# Run the class if this file is run directly +if __name__ == "__main__": + dialog = gtk.Dialog("Output", None, gtk.DIALOG_MODAL, + (gtk.STOCK_OK, gtk.RESPONSE_ACCEPT)) + label = gtk.Label() + label.set_text("\n Please Enter Output Filename: \n") + dialog.vbox.add(label) + label.show() + lineedit = gtk.Entry() + lineedit.set_text("output") + lineedit.show() + dialog.vbox.add(lineedit) + dialog.show() + if ( dialog.run() == gtk.RESPONSE_ACCEPT ): + print lineedit.get_text() + exit(-1) + else: + print "err" + exit(0) + diff --git a/Scripts/Nautilus/.prompt-output.py b/Scripts/Nautilus/.prompt-output.py new file mode 100755 index 0000000..ce94e38 --- /dev/null +++ b/Scripts/Nautilus/.prompt-output.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python + +# Helper Script to ask for the output file name +# John Ryland + +import pygtk +pygtk.require('2.0') +import gtk + +# Run the class if this file is run directly +if __name__ == "__main__": + dialog = gtk.Dialog("Output", None, gtk.DIALOG_MODAL, + (gtk.STOCK_OK, gtk.RESPONSE_ACCEPT)) + label = gtk.Label() + label.set_text("\n Please Enter Output Filename: \n") + dialog.vbox.add(label) + label.show() + lineedit = gtk.Entry() + lineedit.set_text("output") + lineedit.show() + dialog.vbox.add(lineedit) + dialog.show() + if ( dialog.run() == gtk.RESPONSE_ACCEPT ): + print lineedit.get_text() + exit(-1) + else: + print "err" + exit(0) + diff --git a/Scripts/Nautilus/Combine JPG files in to a PDF b/Scripts/Nautilus/Combine JPG files in to a PDF index b8bab1a..67f7aec 100755 --- a/Scripts/Nautilus/Combine JPG files in to a PDF +++ b/Scripts/Nautilus/Combine JPG files in to a PDF @@ -4,7 +4,7 @@ fpaths=`echo "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | sort` PDFARGUMENTS="" -outfile=`~/.gnome2/nautilus-scripts/prompt-output.py` +outfile=`~/.gnome2/nautilus-scripts/.prompt-output.py` if [ "$?" == "0" ] then diff --git a/Scripts/Nautilus/.prompt-output.py b/Scripts/Nautilus/.prompt-output.py new file mode 100755 index 0000000..ce94e38 --- /dev/null +++ b/Scripts/Nautilus/.prompt-output.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python + +# Helper Script to ask for the output file name +# John Ryland + +import pygtk +pygtk.require('2.0') +import gtk + +# Run the class if this file is run directly +if __name__ == "__main__": + dialog = gtk.Dialog("Output", None, gtk.DIALOG_MODAL, + (gtk.STOCK_OK, gtk.RESPONSE_ACCEPT)) + label = gtk.Label() + label.set_text("\n Please Enter Output Filename: \n") + dialog.vbox.add(label) + label.show() + lineedit = gtk.Entry() + lineedit.set_text("output") + lineedit.show() + dialog.vbox.add(lineedit) + dialog.show() + if ( dialog.run() == gtk.RESPONSE_ACCEPT ): + print lineedit.get_text() + exit(-1) + else: + print "err" + exit(0) + diff --git a/Scripts/Nautilus/Combine JPG files in to a PDF b/Scripts/Nautilus/Combine JPG files in to a PDF index b8bab1a..67f7aec 100755 --- a/Scripts/Nautilus/Combine JPG files in to a PDF +++ b/Scripts/Nautilus/Combine JPG files in to a PDF @@ -4,7 +4,7 @@ fpaths=`echo "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | sort` PDFARGUMENTS="" -outfile=`~/.gnome2/nautilus-scripts/prompt-output.py` +outfile=`~/.gnome2/nautilus-scripts/.prompt-output.py` if [ "$?" == "0" ] then diff --git a/Scripts/Nautilus/Combine PDFs b/Scripts/Nautilus/Combine PDFs index 4fe7da7..9b49730 100755 --- a/Scripts/Nautilus/Combine PDFs +++ b/Scripts/Nautilus/Combine PDFs @@ -3,6 +3,7 @@ ' PDFARGUMENTS="" fpaths=`echo "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | sort` +outfile=`~/.gnome2/nautilus-scripts/.prompt-output.py` for file in $fpaths do if [ -f "$file" ]; then @@ -14,21 +15,23 @@ fi fi done + if [ -n "$PDFARGUMENTS" ]; then - cd "$pdfdir" -# echo "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" > blah2.txt -# echo "$PDFARGUMENTS" >> blah2.txt - # eval /usr/bin/pdfjoin $PDFARGUMENTS + cd "$outdir" - x=0 - while [ -e output-$x.pdf ] - do - x=`expr $x + 1` - done + if [ -e $outfile.pdf ] + then + x=0 + while [ -e $outfile-$x.pdf ] + do + x=`expr $x + 1` + done + outfile=$outfile-$x + fi - eval pdftk "$PDFARGUMENTS" output output-$x.pdf + eval pdftk "$PDFARGUMENTS" output $outfile.pdf eval mv "$PDFARGUMENTS" ~/.Trash + #eval rm -rf "$PDFARGUMENTS" fi -