Add to copy/move to menu

nice one steve - that’s working now!

lesson learned: always use the </> to format program code! the absence of a ` or two makes a huge difference!

it’s very handy that the ‘select a directory’ window shows fave folders at the bottom.

it would be great if you could actually add locations to the existing ‘copy/move to’ sub-menus.

thanks again - much appreciated mate!

edit

i’ve made a small change to script so it works with file/folder names that include spaces.

location=`zenity --file-selection --directory --title="Select a directory"`
for arg
   do
     if [ -e "$location"/"$arg" ];then
       zenity --question --title="Conflict While Copying" --text="File "$location/$arg" already exists. Would you like to replace it?"
     case "$?" in
       1 ) exit 1 ;;
       0 ) cp "$arg" "$location" ;;
     esac
     else
       cp "$arg" "$location"
     fi
   done

all i did was to wrap the $arg and $location variable names in quotes.

edit 2

made another script replacing ‘cp’ commands with ‘mv’ to move rather than copy file.

1 Like