?
Solved

making a nautilus script

Posted on 2003-03-07
6
Medium Priority
?
238 Views
Last Modified: 2008-03-06
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
Comment
Question by:pincombe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 2

Accepted Solution

by:
jimbb earned 200 total points
ID: 8094448
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
 

Author Comment

by:pincombe
ID: 8094615
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
 
LVL 2

Expert Comment

by:jimbb
ID: 8094723
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
More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

 

Author Comment

by:pincombe
ID: 8094928
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
 
LVL 2

Expert Comment

by:jimbb
ID: 8095221
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
 

Author Comment

by:pincombe
ID: 8106346
thx for the help mate sorry i was slow :( i wish i had got it working but thats anyway :)
0

Featured Post

Industry Leaders: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month8 days, 8 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question