Saturday Aug 25, 2007

Copy Path in Nautilus

I recently switched to Ubuntu. Starting to like it.

Here is my first Ubuntu/Nautilus hack. Put the following python script:

#!/usr/bin/python

import pygtk
pygtk.require('2.0')
import gtk
import os

# get the clipboard
clipboard = gtk.clipboard_get()

# set the clipboard text data
clipboard.set_text(os.environ['NAUTILUS_SCRIPT_SELECTED_FILE_PATHS'])

# make our data available to other applications
clipboard.store()

in the file:

~/.gnome2/nautilus-scripts/Copy Path

Now launch Nautilus, select any file(s) or folder(s) and invoke pop up menu  and select Scripts:Copy Path. The fully qualified path(s) of the file(s) or folder(s) will be copied to the clipboard.

Does anyone know a better way?

About

sandipchitale

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today