• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 239
  • Last Modified:

making a nautilus script

hi,

could anyone help me make a nautilus script? all i need it to do is copy any files i select and put the copies into this folder /mnt/win_c2/SingleSongs/


thx in advance
keith
0
pincombe
Asked:
pincombe
  • 3
  • 3
1 Solution
 
jimbbCommented:
First, it needs to go into ~/.gnome2/nautilus-scripts (which you probably already knew).

The script takes the selected filenames as commandline arguments.

Here's an example of a script I use to run the selected files with 'mplayer':

$ cat .gnome2/nautilus-scripts/mplayer
#!/bin/sh

exec mplayer -fs "$@"


So in your case you'd want something like this:

#!/bin/sh

exec cp -p "$@" /mnt/win_c2/SingleSongs/

(Don't forget to set the executable bit on the script file.)
0
 
pincombeAuthor Commented:
well i tried both of those scripts and neither of them worked :( i mean i can try and run them but they do nothing

what i did was make a file and pasted

#!/bin/sh

exec cp -p "$@" /mnt/win_c2/SingleSongs/

into into it and then called it copysinglesongs and make sure i ticked the executable button in properties
0
 
jimbbCommented:
OK, I just tried it exactly as pasted and it works....

Firstly, does the script show up in your Scripts menu?

And second, what if you try running the script from a shell to test it?  At least then you'll be able to see if there are any errors.

Example:

cd ~/.gnome2/nautilus-scripts
./copysinglesongs file1 file2 file3
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
pincombeAuthor Commented:
ok i tested the script from the shell and i got this error:

cp: preserving times for `/mnt/win_c2/SingleSongs/elec.mp3': Operation not permitted

what do you reakon?
0
 
jimbbCommented:
Ahh, ok.

man cp: the "-p" flag is to preserve the date/time of the files you copy.

If you're copying to a Windows filesystem, I think it doesn't allow you to do that.

Take out the "-p" and just use:

exec cp "$@" /mnt/win_c2/SingleSongs/
0
 
pincombeAuthor Commented:
thx for the help mate sorry i was slow :( i wish i had got it working but thats anyway :)
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now