Environment variable
::Description
NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
::Newline-delimited
paths for selected files (only if
local)
NAUTILUS_SCRIPT_SELECTED_URIS
::Newline-delimited URIs for selected
files
NAUTILUS_SCRIPT_CURRENT_URI
::The current
location
NAUTILUS_SCRIPT_WINDOW_GEOMETRY
::The position and size of the
current window
In Python, you obtain the value of these variables with a single call to
the os.environ.get function as follows:
selected = os.environ.get
('NAUTILUS_SCRIPT_SELECTED_FILE_PATHS,'')
This call returns a string with paths to all the selected files
delimited with the newline character. Python makes it easy to turn [snip]
into an iterable list with the following line:
targets = selected.splitlines()
Here's the link to this valuable Gnome tool. Of course I'm not a big fan of Gnome. I like the code better. Gnome is ghastly to anyone with insight into operating systems.
[This post was modified twice]