clechasseur / pathcopycopy

Copy file paths from Windows explorer's contextual menu
https://pathcopycopy.github.io
MIT License
1.03k stars 80 forks source link

[FEATURE] Be able to insert newlines in copied paths #174

Open ZPMU opened 1 year ago

ZPMU commented 1 year ago

Is your feature request related to a problem? Please describe. I want to take a path and convert it two times, seperated by a newline or some other seperation char: First it should converted like done by "Copy long UNC path", then again like done by "Copy samba path", both concatenated by newline. Problem: Don't know how to do after reading https://github.com/clechasseur/pathcopycopy/wiki/Custom-Commands-%3A-Expert-Mode

Describe the solution you'd like I have no clue about the expert mode, but my gut says that it ist possible by that means, resorting to two of the Base Commands.

Describe alternatives you've considered Build the two paths manually by means of a complicated RegExp, omitting the savvy hidden in both Base Commands.

Additional context The existing stack manipulating elements let me tempt to apply knowledge about UPN based calculators/languages. From my experience with UPN, I think it should be somewhat like "Duplicate top stack element" "Convert top stack element to Samba" "Swap two topmost stack elements" "Convert top stack element to UNC" "Push newline to stack" "Swap two topmost stack elements" "Concatenate two topmost stack elements" "Concatenate two topmost stack elements"

Supposing that each Base command take a path from stack, an push the treated result to stack. Supposing that initial file path is present on stack and final result (to be deposited in clipboard) shall be left on the stack.

clechasseur commented 1 year ago

Indeed, this is almost possible with stack manipulation. Here's an example:

CopyUNCAndSambaPaths.zip

However, this example pushes the string " | " between the two paths. This is because there doesn't seem to be a way to push a true newline onto the stack.

I'll keep this open to see if there's a way to add this.

ZPMU commented 1 year ago

Thanks, that clarifys some points. I think that nevertheless the docs are a little bit narrow. I think, more examples may give a glimpse of the concepts. In the meantime I found a solution similar, but not that concise. But indeed, I also didn't find a solution to use a newline as seperation string. "\n" or "$n" or variations with more than one "\" or with "\r" or "\r\n" or the like didn't make it. So this issue forks into the two tasks "give more examples in the docs" and "let the user insert line breaks onto the stack", IMHO.