Oracle® Solaris 11.2 Desktop User's Guide

Exit Print View

Updated: July 2014
 
 

Scripts

The file manager can run scripts written in any scripted language capable of being executed on the computer. Scripts are typically simpler in operation than using file manager extensions. To run a script, choose File → Scripts, and 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, and 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 might also access scripts from the context menu.


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

Installing File Manager Scripts

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

To install a script, copy the script to the script folder and assign the user executable permission.

To view the contents of your scripts folder, choose File → Scripts → Open Scripts Folder. Navigate to the scripts folder using the file manager if you do not yet have any scripts. If you need to show hidden files to show the script, choose View → Show Hidden Files.

Writing File Manager Scripts

When executed from a local folder, scripts will be passed the selected file names. When executed from a remote folder, 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