PDA

View Full Version : nautilus-script move/copy file



bro
December 27th, 2006, 11:04 AM
Hi, I'd like to have a nautilus scritp that moves a file to my home directory. I found the script below that should copy it. It doesn't work. why not?


#!/bin/sh
# copyhome: copies the selected file(s) to home directory
# (if able)

for arg
do
if [ -f ~/"$arg" ]; then
MSG="File: '$arg' already exists in home directory. Overwrite?"
if
gdialog --title "Overwrite?" --defaultno --yesno "$MSG" 200 100

then
cp "$arg" ~/"$arg"
fi
else
cp "$arg" ~/"$arg"
fi

done

hadiriazi
December 27th, 2006, 01:43 PM
do you have to issue a command in a terminal to do this?

bro
December 27th, 2006, 05:27 PM
no i use nautilus scripts located in /home/~user/.gnome2/nautilus-scripts/ and I find them in the menu under my right mouse button. Like the ones at http://g-scripts.sourceforge.net/ only I can't find out how to actually make them myself (properly). Hence the question above, what's wrong with the script?

Keith Hedger
January 16th, 2007, 04:55 PM
make sure the execute bit is set for the script also when copying/creating a new nautilus script in the scripts folder you may have to click the reload button to make nautilus regonize the changes