Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

1 Answer 1

up vote 3 down vote accepted

The error is on line 150

if [ -z "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" ]; then

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

 
discard

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.