I use Ubuntu 11.10 with its default file manager, Nautilus 3.2.1.
Please, if possible, I'd like someone gentle to create for me (yes, "create for me" because I'm still a beginner on Linux to create it myself) two "batch" files (on Linux it's called "script", right?).
The first script, I want it to do the following...
1) I right-click a folder and, in the context menu, the words "Create list of contents" should appear.
2) After clicking "Create list of contents", it should generate a TXT file (into any folder, DOCUMENTS, for example) only with the names of the files and/or folders inside the clicked folder. Then, automatically, the generated TXT file should be opened (with Gedit, for example).
I have such thing on Windows. Actually, they are DOS commands, a batch file. It runs a DIR command in the clicked foder and sends the result of that DIR command to a TXT file. I don't know whether the logic for Linux is the same. Just for illustration, take a look at the batch file I use on Windows:
Batch file name: CreateList.bat
if errorlevel 1 goto :checktempfile
del List.txt /q
if errorlevel 1 goto :listcontents
del %USERPROFILE%\AppData\Local\Temp\List.txt /q
dir /a /b /-p /o:gen > %USERPROFILE%\AppData\Local\Temp\List.txt
copy %USERPROFILE%\AppData\Local\Temp\List.txt %1
start "" List.txt
This is how it works on Windows:
1) I have this batch file in the folder: "D:\Batches\CreateList.bat"
2) I have an option "Create list of contents" in the folder context menu of Windows Explorer.
3) When I right-click any folder and then click on "Create list of contents" in the context menu, it runs that "D:\Batches\CreateList.bat" file.
I don't know whether the logic for Linux is the same, but if so, it would be something like:
1) A script file in a folder: "/home/Scripts/CreateList.sh"
2) An option "Create list of contents" in the folder context menu of Nautilus.
3) When I right-click any folder and then click on "Create list of contents" in the context menu, it runs that "/home/Scripts/CreateList.sh" file.
This is "my" logic, for I don't understand about Linux. Maybe, on Linux, the process is much simpler. Maybe the commands are put directly on Nautilus, I don't know. I don't understand.
Obs.: I use the same logic for the "CopyImages.bat".
The second script, I want it to do the following:
1) I right-click a folder and, in the context menu, the words "Copy image files" should appear.
2) After clicking "Copy image files", it should copy all image files of any type (JPG, BMP, PNG, etc.) from the clicked folder, including its subfolders (this is very important), into another one (any folder, DOCUMENTS, for example).
I have such thing on Windows, I mean, on DOS. Just for illustration, take a look at the batch file I use on Windows:
Batch file name: CopyImages.bat
for /r %%i in (*.jpg) do copy /y "%%i" "D:\Arquivos\Temp\Imagens"
Obs.: In this case, it copies only JPG files, but I want it to copy any image files.
As I said before, I need someone to create the script for me. I don't know how to do it. However, after I have a script already created, I can study its commands and see how the logic works and etc., then I can, who knows, create my own scripts, by myself.
The examples above refer only to the batch files, of course. To have those words in the context menu, I have two other files I've created to add those options to the Windows registry.
I thank very much any gentle person who can do me this favor.