GNOME.ORG

Nautilus Scripts

Nautilus can run scripts. Scripts are typically simpler in operation than full Nautilus extensions and can be written in any scripted language capable of being executed on your computer. To run a script choose File ▸ Scripts, then choose the script that you want to run from the submenu.

To run a script on a particular file, select the file in the view pane. Choose File ▸ Scripts, then choose the script that you want to run on the file from the submenu. You can also select multiple files to run your scripts on.

You may also access scripts from the context menu.

If you do not have any scripts installed, the script menu will not appear.

6.13.1.1. Installing File Manager Scripts

The file manager includes a special folder where you can store your scripts. All executable files in this folder will appear in the Scripts menu. The script folder is located at $HOME/.gnome2/nautilus-scripts.

To install a script, simply copy the script to the script folder and give it the user executable permission.

To view the contents of your scripts folder, if you already have scripts installed, choose File ▸ Scripts ▸ Open Scripts Folder. You will have to navigate to the scripts folder with the file manager if you do not yet have any scripts. You may need to show hidden files for this, use View ▸ Show Hidden Files

A good source to download Nautilus scripts is from the G-Scripts website.

6.13.1.2. Writing File Manager Scripts

When executed from a local folder, scripts will be passed the selected file names. When executed from a remote folder (e.g. a folder showing web or ftp content), scripts will be passed no parameters.

The following table shows variables passed to the script :

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 URI for current location
NAUTILUS_SCRIPT_WINDOW_GEOMETRY position and size of current window