wgw
August 31st, 2008, 10:59 PM
I would like to write a Nautilus script that will use a script with cp to copy files instead of the normal paste in Nautilus. (Sounds redundant, doesn't it? I explain below.) I need to replace files without moving them to the trash. I am most comfortable with python, but can muddle through bash.
My problems:
1) Is there a variable with the list of files that have been selected with ctrl-c ? NAUTILUS_SCRIPT_SELECTED_FILE_PATHS tells me what is presently selected, but if I move to another directory to do the paste, that value changes (AFAIK). I don't see how I can select the files, run the script that grabs NAUTILUS_SCRIPT_SELECTED_FILE_PATHS, then navigate to another directory (while the script is running?), then tell the script to paste the files in the new directory (especially if it is in a different Nautilus window).
2) How does python get access to the Nautilus variables? (Sorry, being lazy; haven't really experimented with that question).
3) Is there a comprehensive tutorial for Nautilus scripting that would answer such questions (especially python oriented)?
Thanks for any suggestions!
PS: I am trying to do a workaround for managing files on Blackboard's webdav. When Nautilus overwrites a file it moves the old version to .Trash-user. Under Blackboard that is causing problems, because it catalogs the files on the system and follows the moved file to the trash. If I use cp, which simply overwrites the old version of the file, all works as expected. So I am trying to write a shortcut to do a "no trash" file replace through Nautilus. (Nautilus does have a "no-trash" delete, but not a no-trash replace.)
My problems:
1) Is there a variable with the list of files that have been selected with ctrl-c ? NAUTILUS_SCRIPT_SELECTED_FILE_PATHS tells me what is presently selected, but if I move to another directory to do the paste, that value changes (AFAIK). I don't see how I can select the files, run the script that grabs NAUTILUS_SCRIPT_SELECTED_FILE_PATHS, then navigate to another directory (while the script is running?), then tell the script to paste the files in the new directory (especially if it is in a different Nautilus window).
2) How does python get access to the Nautilus variables? (Sorry, being lazy; haven't really experimented with that question).
3) Is there a comprehensive tutorial for Nautilus scripting that would answer such questions (especially python oriented)?
Thanks for any suggestions!
PS: I am trying to do a workaround for managing files on Blackboard's webdav. When Nautilus overwrites a file it moves the old version to .Trash-user. Under Blackboard that is causing problems, because it catalogs the files on the system and follows the moved file to the trash. If I use cp, which simply overwrites the old version of the file, all works as expected. So I am trying to write a shortcut to do a "no trash" file replace through Nautilus. (Nautilus does have a "no-trash" delete, but not a no-trash replace.)