Nautilus Scripting Questions
Nautilus scripts get passed three parameters that are of use to me: $NAUTILUS_SCRIPTS_SELECTED_URIS, $NAUTILUS_SCRIPTS_SELECTED_FILE_PATHS, and $NAUTILUS_SCRIPT_CURRENT_URI.
The names of the variables should explain what they are but if not, I made a nautilus script that simply displays the value of these variables. When I right click on a file named "Clear Trash" on my desktop and run the script, here are the values for these variables: $NAUTILUS_SCRIPTS_SELECTED_URIS = file://home/ubuntu/Desktop/Clear%20Trash $NAUTILUS_SCRIPTS_SELECTED_FILE_PATHS = /home/ubuntu/Desktop/Clear Trash $NAUTILUS_SCRIPT_CURRENT_URI = file:///home/ubuntu/Desktop Now here's the goal of my script: to execute the files selected in nautilus with root permissions. I've tried the "sudo $NAUTILUS_SCRIPTS_SELECTED_URIS" and "sudo NAUTILUS_SCRIPTS_SELECTED_FILE_PATHS" commands. Neither works. HOWEVER, I have another script with the command "gksudo gedit $ NAUTILUS_SCRIPTS_SELECTED_URIS" and it works flawlessly. So if the command, Quote:
Quote:
Quote:
|
the first works because you are executing the program 'gedit'
the second, you may or may not be executing an executable (what are you looking to do; do you just want root to be able to veiw the script?) |
Quote:
|
i am not in front of my computer rite now but the way i remember it works is nautilaus reads scripts from a default directory (something like: ~home/user/nautilaus-scripts) so whenever you right-click on a file it shows up in the nautilaus scripts menu.
assuming 'clear trash' is the target script i would think the space is throwing it off. (you probably wouldn't be able to run it from the command line because of the space) try renaming it to something like clear-trash.ksh |
All times are GMT -5. The time now is 02:22 PM. |