Score:0

Add context menu for file passing multiple parameters to target

ca flag

I would like to use an AI subtitles sync program (Alass). This is very simple in Linux/bash but I was trying for a way to achieve this using Windows and the context menu. So here my requirement:

  • make the context menu appear when two files are selected AND one of the two files is .srt
  • Given I would select two files in no particular order, the first (%1) would always need to be the video one (mkv/mp4/avi/etc)
  • The second (%2) would always need to be the .srt
  • the third can a static out.srt created in the very same folder where %1 and %2 live

Essentially the user action would be:

  • Select video and subtitles while pressing CTRL
  • right click
  • select "Sync sub"
  • The "C:\program files\alass.bat %1 %2 out.srt" is called
  • Alass is run and saves on the path where %1 and %2 live

Currently using this:

Computer\HKEY_CLASSES_ROOT\SystemFileAssociations\.srt\shell\Alass

command=C:\WINDOWS\system32\cmd.exe /D /C "Start "" /D "%V" "C:\Program Files\Alass\alass.bat" \"%1\" \"%2\" alassout.srt"

But I get a "The app does not have an app associated.... error message" plus the context menu appears only if the .srt only is selected

What I would need help with is:

  • How to I make a .srt extension always be passed as %2 (perhaps a modification of the .bat is needed for this to identify .srt and whatever video in whatever order they are passed?)
  • How do I make the context menu appear if one of the two files is .srt
  • What do I need to pass to the Context command to make it save in the very same folder where %1 and %2 live?

Thank you!

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.