* On Thu, Aug 31, 2006 at 11:42:12PM +1000, Sonia Hamilton wrote:
> Anyone know how I can associate a script with a file type in Gnome
> Nautilus, so that when I right-click on the file I can get it to run the
> script?
> 
> As a bit of background, I'm using pdftk to pull out pages out of heaps
> of pdfs (for a custom IT course) - rather than flicking over to a
> terminal, changing directories & typing in 'pdftk *.pdf burst', I'd like
> to be able to right-click on the file, choose the option 'burst', et
> voila!

I got an off-list reply to this:

> Try using the "right click" -> "open with" -> "open with other
> Application ..." option
> then choose "use custom command" and bobs your Uncle

Here's the 2 scripts I wrote and associated with pdfs to pull apart
and combine pdfs:

$ cat pdftk_burst
#!/bin/bash
cd ${1%/*}
/usr/bin/pdftk "$1" burst
rm doc_data.txt

$ cat pdftk_cat
#!/bin/bash
cd ${1%/*}
outfile="00out.pdf"
if [ -f $outfile ] ; then
    rm -f $outfile
fi
/usr/bin/pdftk *.pdf cat output $outfile

Sweet!

-- 
Sonia Hamilton. GPG key A8B77238.
.
One OS to rule them all, One OS to find them.
One OS to call them all, And in salvation bind them.
In the bright land of Linux, Where the hackers play. 
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to