0

I have a bash script that use zenity as GUI.

I need to get a list of files in the same order as I select them.

I use --file-selection option and working fine but it put in the output variable always the file names as an alphabetic ordered list but I need a list ordered as I selected it.

For example if I have a.txt b.txt d.txt and z.txt and I select them in this order:

d.txt, a.txt, z.txt, b.txt

I would like that in output variable them are reported exactly as I have seleceted.

Any help is very apreciated. Thank in advance,

Emilio

3
  • 1
    The fGTK file dialog does not work that way. It lets you select files, and then just passes them on in alphabetical order, just accounting for the files that were selected, not the order by which they were selected.
    – vanadium
    Jan 12, 2021 at 18:57
  • ok, there are other metoth with a GUI to re order the file selected for example with a combobox where I can assign to any file a numer for re order ? Jan 13, 2021 at 11:03
  • I don't know. You will have to see what answers you get.
    – vanadium
    Jan 13, 2021 at 11:57

1 Answer 1

0

The "ugly" solution that I have adopted is:

  1. select file with zenity --file-selection with multiple selection enabled;
  2. show the file selected an its order in zenity --list with multiple selection disabled

Every SINGLE file selected in list is loaded clicking "OK" (renamed "Select") and is put into a new variable that is display with zenity --notification.

When all is done, you clik cancel (renamed "DONE")

Not elegant, but functionality.

I have not found other solution with zenity.

Maybe using yad ... but I have not installed end cannot install it ...

Emilio

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .