SendTo with SubFolders Needed [resolved]

Discuss anything related to portable freeware here.
Message
Author
Stoik
Posts: 83
Joined: Fri Jan 29, 2016 12:25 pm

SendTo with SubFolders Needed [resolved]

#1 Post by Stoik »

Do You guys know of a
portable freeware (or similar) solution to this problem.

For many of You this is a familiar issue,
but for those who do not know what I am talking about - here is the problem description ...

In all Windows versions before Windows 8 You could create sub-folders in Your SendTo system folder,
which would enable You to nicely categorize Your shortcuts (e.g. Audio Players, Video Players, Text Editors ...);
Windows 8 killed that function (God knows why), sub-folders do not "branch out" to display their contents.

The SendTo folder in my Windows 8 system is :
C:\Users\User\AppData\Roaming\Microsoft\Windows\SendTo.

Currently I am using the portable FileMenu Tools as a work-around :
http://www.portablefreeware.com/index.php?id=2243
http://www.lopesoft.com/index.php/en/filemenutools

But I am having problems with FileMenu Tools (FMT) :
1. You have to manually edit each entry - which is a pain in the neck, You can not just copy a bunch of short-cuts to a certain location,
2. You have to install a shell extension to activate the FMT context menu, but this extension is prone to crashes randomly,
3. if FMT is populated with many links, the FMT context menu is very slow to start/display.

I am looking for a tool that :
1. You can hook into the context menu, and that will branch out various categorized sub-menus,
2. will accept me just copying a bunch of short-cuts (including sub-folders) to a designated location - rather than editing links one by one.

As an example, a perfect tool for handling links in sub-folders is the portable Quick Pop Menu.
You just copy Your links (& sub-folders) into the program folder, and You are done.
The only problem (& this one kills it): this is just a program launcher, not a SendTo handler.

If You are interested, here is more info on Quick Pop Menu:
http://www.softpedia.com/get/Desktop-En ... Menu.shtml
http://en.michaeluno.jp/quick-pop-menu/

Suggestions about
software solutions (to this problem) or Windows hacks
would be most welcome.
Last edited by Stoik on Fri Jul 01, 2016 4:02 pm, edited 1 time in total.

Stoik
Posts: 83
Joined: Fri Jan 29, 2016 12:25 pm

Re: SendTo with SubFolders Needed

#2 Post by Stoik »

I will update You on my own research.

I might be onto something with the portable DropIt program :
http://www.portablefreeware.com/index.php?id=1531

I am using DropIt via SendTo,
then DropIt pops up a menu for me to choose an application
if there is more than one application associated with the same extension.
Also, this way, the DropIt program does not remain open after use.

DropIt is perfect for this use except for one significant problem :
You have to edit every association manually,
and if You have a lot of short-cuts in mind, that can take a long while.

I am trying to figure out a way to use DropIt in association with
a specific folder (including sub-folders) full of .lnk files.
That would spare me all that manual editing.

Does anyone know how to do that ?

User avatar
smaragdus
Posts: 2120
Joined: Sat Jun 22, 2013 3:24 am
Location: Aeaea

Re: SendTo with SubFolders Needed

#3 Post by smaragdus »

@Stoik
Quick Pop Menu has already been discussed here.

Stoik
Posts: 83
Joined: Fri Jan 29, 2016 12:25 pm

Re: SendTo with SubFolders Needed

#4 Post by Stoik »

Thanks, smaragdus,
I appreciate it.

But I mentioned Quick Pop Menu
merely as an example of good short-cut (& sub-folder) handling.

Unfortunately, Quick Pop Menu is a different program type.
It is just a straight program LAUNCHER, and not a SEND-TO manager.
In other words, You can not send (or drag-and-drop) a .txt file to a Quick Pop Menu short-cut,
and have a menu pop up "asking You" which program to use (& then the .txt file opens in that program).

User avatar
lintalist
Posts: 436
Joined: Sat Apr 19, 2014 12:52 am
Contact:

Re: SendTo with SubFolders Needed

#5 Post by lintalist »

Wouldn't AutoHotkey also be the solution here, a very basic proof of concept below, assuming you want it to work in XYplorerer. You don't want to override the default rightclick menus so I made a new rightclick combo: shift+rightclick
^p copies the path(s) of the selected file(s) to the clipboard which you can process.

You can dress this up and build the menu dynamically, add icons of course and also take into account various methods (per program) on how to get the selected/current file etc. Again just a proof of concept.

Code: Select all

#SingleInstance, force

Menu, SendToMenu, Add, Notepad.exe, MenuHandler
Menu, SendToMenu, Add, Wordpad.exe, MenuHandler
Menu, SendToMenu, Add, MsPaint.exe, MenuHandler

#IfWinActive ahk_exe XYplorerFree.exe
+Rbutton::
Send ^p
Sleep 100
Menu, SendToMenu, Show
Return
#IfWinActive

MenuHandler:
Loop, parse, clipboard, `n, `r
	{
	 If (A_LoopField = "")
	 	continue
	 Run, %A_ThisMenuItem% %A_LoopField%
	}
Return

Hawk
Posts: 4
Joined: Fri Feb 01, 2013 2:29 am

Re: SendTo with SubFolders Needed

#6 Post by Hawk »

I wish I had something like the copy/move menu of KDE.

Image

shnbwmn
Posts: 265
Joined: Sat Jul 11, 2015 12:59 am

Re: SendTo with SubFolders Needed

#7 Post by shnbwmn »

Right Click Enhancer - portable version available.

Image

Unfortunately, adding submenus as shown above is only available in the "Professional" version.

http://rbsoft.org/compare-right-click-e ... ofessional :?
Last edited by shnbwmn on Thu Jun 30, 2016 9:51 am, edited 1 time in total.

billon
Posts: 843
Joined: Sat Jun 23, 2012 4:28 pm

Re: SendTo with SubFolders Needed

#8 Post by billon »


Stoik
Posts: 83
Joined: Fri Jan 29, 2016 12:25 pm

Re: SendTo with SubFolders Needed

#9 Post by Stoik »

Well, well ...
Lots of good responses.

However, none of them seem to quite hit the target
(links in sub-folders, instead of manually editing link by link).

Suggestion by "Billon" :
I am familiar with Open++ and KuShellExtension.
Both require manual editing of links, line by line.
Also, Open++ does not offer sub-folders (even with manual editing) as far as I can see.

Suggestion by "Shnbwmn" :
Right Click Enhancer Pro is a strange one.
In the help file it sounds so wonderful, but in practice it does not seem to work.
Using their "Right Click ShortCuts Creator" creates nothing in XYplorer or other File Managers,
in Windows (File) Explorer the new menu is sometimes there and sometimes not (very buggy).

Suggestion by "LintaList" :
Yes, AutoHotKey ! I should have thought of that.
I do use AutoHotKey quite often, but my knowledge does not seem to be even 10 % of Your knowledge.
I could not figure out how Your script is supposed to work - nothing seems to happen.
So, would You please explain to me how I am to do this :
1. make a "program" folder for the script that You are suggesting,
2. in this "program" folder create a sub-folder called "ShortCuts",
3. inside the "ShortCuts" folder, create 2 new sub-folders called: "TXT", and "DOC",
4. fill up the TXT folder with 5 or 6 links (.lnk files) to text editors, and the DOC folder with a few links to DOC editors (Office Word, OpenOffice Writer),
5. select any sample .txt file, activate the context menu, and somewhere there are too sub-menus with TXT and DOC links (that fully branch out),
6. when I click on one of the links (e.g. NotePad), the selected sample .txt file opens in NotePad.

Actually, LintaList, when You are done,
You may want to publish this to accompany You other great program - the LintaList !

Thanks !

User avatar
lintalist
Posts: 436
Joined: Sat Apr 19, 2014 12:52 am
Contact:

Re: SendTo with SubFolders Needed

#10 Post by lintalist »

Are they actually .lnk files? I'm asking as I don't think .lnk files can be dynamic e.g. use relative paths for example.

Parsing a folder structure to build a menu isn't too hard, but I'm wondering about the .lnk files... There is the ahk command "FileGetShortcut" which you can use to read the target program so it wouldn't be a problem I'm just wondering if another format wouldn't be easier INI for example where you could use relative paths such "..\..\Editors\npp\notepad++.exe" for example.

Edit: the example above, make sure you have XYplorerFree running, select one or more files, SHIFT and RIGHTCLICK and a menu with notepad.exe etc should show up.

User avatar
lintalist
Posts: 436
Joined: Sat Apr 19, 2014 12:52 am
Contact:

Re: SendTo with SubFolders Needed

#11 Post by lintalist »

This works for me. Make sure you have selected one or more files first. Press shift & RIGHT BUTTON and a menu should popup, it assumes there are two folders DOC and TXT with .lnk files in them. Each .lnk file will become a menu entry.

Code: Select all

#SingleInstance, force

MenuFolders:="DOC,TXT"

Loop, parse, MenuFolders, CSV
	{
	 folder:=A_LoopField

	 Loop, %folder%\*.lnk
		{
		 ; program:=StrReplace(A_LoopFileName, ".lnk") ; StrReplace was introduced in AutoHotkey v1.1.21
		 StringReplace,program,A_LoopFileName, .lnk
		 FileGetShortcut, %folder%\%A_LoopFileName%, OutTarget
		 Menu, %folder%, Add, %program%, MenuHandler
		 Menu, %folder%, Icon, %program%, %OutTarget%
		}
	 Menu, SendToMenu, Add, %folder%, :%folder%
	}

#IfWinActive ahk_exe XYplorerFree.exe
+Rbutton::
Send ^p
Sleep 100
Menu, SendToMenu, Show
Return
#IfWinActive

MenuHandler:
Loop, parse, clipboard, `n, `r
	{
	 If (A_LoopField = "")
	 	continue
	 FileGetShortcut, %A_ThisMenu%\%A_ThisMenuItem%.lnk, OutTarget
	 Run %OutTarget% %A_LoopField%
	}
Return
	
How it should look:
Image

AHK (BASIC) version 1.0.48.05

Code: Select all

#SingleInstance, force
SetTitleMatchMode, 2

MenuFolders:="DOC,TXT"

Loop, parse, MenuFolders, CSV
	{
	 folder:=A_LoopField

	 Loop, %folder%\*.lnk
		{
		 ; program:=StrReplace(A_LoopFileName, ".lnk")
		 StringReplace,program,A_LoopFileName, .lnk
		 FileGetShortcut, %folder%\%A_LoopFileName%, OutTarget
		 Menu, %folder%, Add, %program%, MenuHandler
		 ; Menu, %folder%, Icon, %program%, %OutTarget%
		}
	 Menu, SendToMenu, Add, %folder%, :%folder%
	}

#IfWinActive XYplorer Free Edition
+Rbutton::
Send ^p
Sleep 100
Menu, SendToMenu, Show
Return
#IfWinActive

MenuHandler:
Loop, parse, clipboard, `n, `r
	{
	 If (A_LoopField = "")
	 	continue
	 FileGetShortcut, %A_ThisMenu%\%A_ThisMenuItem%.lnk, OutTarget
	 Run %OutTarget% %A_LoopField%
	}
Return
Last edited by lintalist on Thu Jun 30, 2016 12:56 pm, edited 2 times in total.

Stoik
Posts: 83
Joined: Fri Jan 29, 2016 12:25 pm

Re: SendTo with SubFolders Needed

#12 Post by Stoik »

Dear "LintaList",

Thank You very much !
Your screen-shot looks fantastic.

I am getting a script error in line 11, though.
Therefore, the script exits automatically.

Otherwise, it seems like 99 % of it is done !
Almost there !
Last edited by Stoik on Thu Jun 30, 2016 12:12 pm, edited 1 time in total.

User avatar
lintalist
Posts: 436
Joined: Sat Apr 19, 2014 12:52 am
Contact:

Re: SendTo with SubFolders Needed

#13 Post by lintalist »

I'm guessing you have an older version of AutoHotkey, StrReplace was introduced in v1.1.21+ but I edited the script above and replaced it with the traditional StringReplace command so should work now.

Stoik
Posts: 83
Joined: Fri Jan 29, 2016 12:25 pm

Re: SendTo with SubFolders Needed

#14 Post by Stoik »

LintaList,

You are right, I am using AutoHotKey version 1.0.48.05.
I did not upgrade, since then I would have to re-write many of my existing scripts.
It would be nice if there was some sort of "translator" program (old syntax to new syntax).

Now line 11 is OK, but line 15 causes an error.
Please, help (still "almost there") !

User avatar
lintalist
Posts: 436
Joined: Sat Apr 19, 2014 12:52 am
Contact:

Re: SendTo with SubFolders Needed

#15 Post by lintalist »

You can comment that line as there is no equivalent command to have icons in menus in v1.0.48.05.

Of course I don't know your scripts, but for say 99% of the scripts (unless you use the old COM related stuff to automate Office and Internet Explorer) you can simply upgrade. If you're unsure you can download the portable version from the AHK website and choose the ANSI 32-bit version. Most scripts will work just fine I think.
Some of the syntax has become more strict so in your current script there might be an error which it simply ignores but you would need to fix.
You can try it script by script by simply running it manually autohotkey.exe yourscript.ahk and see if it generates an error.

An alternative method would be to start using the new ahk for new scripts and have two versions, something other people do with autohotkey v2 for example that is under devolpment and in alpha versions (where syntax does change regularly and breaks scripts).

Post Reply