no file selected

Bug #1862799 reported by xcape77 on 2020-02-11
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Compress-PDF
Undecided
Unassigned

Bug Description

Hello

I am using Linux Mint 19.3 Cinnamon and the latest Version of this script.

I placed it under ~/.local/share/nemo/scripts

But this script is not working, if I select a file and call the script I get the error message, that no file is selected.

Thanks in advance for help

xcape77 (xcape77) wrote :

Hello, I think this is not a bug. The script is for Nautilus. But maybe someone can optimize this for also working with Nemo on Linux Mint.

This is not working with Nemo (Scripts)
if [ "x$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" = "x" -o "$#" = "0" ] # we double check. Remove the first part if you plan to manually invoke the script

Thanks

oriolpont (oriolpont) on 2020-02-12
Changed in compress-pdf:
status: New → Triaged
oriolpont (oriolpont) wrote :

Right. Feel free to remove that condition, leave it only as [ "$#" = "0" ].

Back in the day, it used to be possible to run Nautilus scripts without any file selection (not anymore). That test provided an extra caution to abort execution in that situation, before actually going to check that the arguments are valid. It is superfluous.

oriolpont (oriolpont) wrote :

Looking forward, I think that extra condition could be safely removed for anyone, Nautilus users included. The argument count check should be enough. The script works on the arguments passed to it, and it does not use $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS anywhere else. AFAICT, Nautilus has always passed the selected paths as arguments to the scripts. Could anyone confirm this?

Specifically, the only edge case would be that Nautilus somehow invokes the script with no selection yet with some (presumably invalid) argument. In that case, the script would fail with "invalid files" message instead of "no files selected", which is arguably better for an unanticipated setting: The latter incites the user to keep trying.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers