Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to add the script 'compress-pdf' to Thunar custom actions.

The script is the one posted in this answer, made to resize pdfs. It is based on zenity.

It was made for Nautilus, but, as stated there, it 'does not depend on any custom Nautilus variables and can be used with pretty much any file manager out there that supports custom menu actions.'

I have added the script into a text file, made it executable, and added the path to it into Thunar custom actions with the name 'resize pdf'.

enter image description here

But, when right-clicking the selected pdf and running 'resize pdf', I get this error:

enter image description here

Why is that and how to fix it?

(Maybe the zenity script needs indeed adjustment to work in Thunar custom actions?)

share|improve this question
up vote 3 down vote accepted

The error is on line 150


The variable NAUTILUS_SCRIPT_SELECTED_FILE_PATHS does not exist. You need to replace it by pdf_file defined on line 140.

New line 150:

if [ -z "$pdf_file" ]; then

The adjusted version of the script can be found here.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.