end2endzone / ShellAnything

ShellAnything is a C++ open-source software which allow one to easily customize and add new options to *Windows Explorer* context menu. Define specific actions when a user right-click on a file or a directory.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Show folder's content as menu items

sunvis0r opened this issue Β· comments

Hi πŸ‘‹

Is there any way to dynamically generate properties based on files in folder? I mean show folder's content as menu items
I'm trying to replace the default "New" context menu with my own so that files can be copied and pasted from a defined folder. For now ShellAnything supports only properties by selection, fixed properties, properties defined in XML and properties from Windows environment.

Is that justified as new feature? Or better solution is to generate XML file from batch file?

Hi. Thank you for your question. Unfortunately, there is no feature in ShellAnything that could display an arbitrary numbers of menu items. All menu items must be predefined in an xml file. If a directory contains 15 images labeled IMG_0001.jpg to IMG_0015.jpg, ShellAnything would not be able to "detect these 15 files" and display 15 menus items. Also, if you would create a 16th image file in the same directory, you would not get a new menu with 16 sub items.

However, I think you could use ShellAnything for achieve something quite similar.

If I understand correctly what you need, I would assume that you have a custom directory (for example c:\my_new_files_templates which contains templates/empty files for multiple applications. Lets say you have 15 template files mostly named new_file.wav, new_file.jpg, new_file.xls, new_file.html, new_file.xml, and so on... For this to work, you could create an xml file with 15 entries (mostly copied pasted from each other except for the file extension). When you right-click a directory, it would show a menu called New document from my templates with 15 sub menus. Clicking on sub menu "html" would call a custom executable (with or without a gui or with a command line) to copy file c:\my_new_files_templates\new_file.html to the target directory (the one you right-clicked). The destination directory is available with ${selection.path}.

The only problem is that if you add another template file (for example c:\my_new_files_templates\new_file.ppt), you would have to manually add another entry for ppt in the xml configuration file. This step could be automated with a script for simplicity. Heck, you could also create a "refresh" menu item that launches this script. If you do not know how to write a script that would detect all 16 files and create xml entries for each one, you could simply do it manually. In worst case, the menu item would still show 15 sub menus items until you add the new ppt entry in the configuration file.

Edit: typo.

You should also ready read the User manual. It contains all kinds of different scenarios on how ShellAnything could be helpful and details on each functionality.

I hope my proposition solves your problem. If you find ShellAnything useful, please leave a star to the project. This help me a lot and encourage me to continue supporting ShellAnything. Please close this issue if my suggestion/workaround solves your problem.

This is an incredibly impressive idea with the "refresh" menu item to the context menu
Thank you for your answer!