[GH-ISSUE #174] [FEATURE] Be able to insert newlines in copied paths #170

Open
opened 2026-02-25 21:32:47 +03:00 by kerem · 2 comments
Owner

Originally created by @ZPMU on GitHub (Sep 26, 2023).
Original GitHub issue: https://github.com/clechasseur/pathcopycopy/issues/174

Originally assigned to: @clechasseur on GitHub.

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.

Originally created by @ZPMU on GitHub (Sep 26, 2023). Original GitHub issue: https://github.com/clechasseur/pathcopycopy/issues/174 Originally assigned to: @clechasseur on GitHub. **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.
Author
Owner

@clechasseur commented on GitHub (Sep 28, 2023):

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.

<!-- gh-comment-id:1738394252 --> @clechasseur commented on GitHub (Sep 28, 2023): Indeed, this is _almost_ possible with stack manipulation. Here's an example: [CopyUNCAndSambaPaths.zip](https://github.com/clechasseur/pathcopycopy/files/12745333/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.
Author
Owner

@ZPMU commented on GitHub (Sep 29, 2023):

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.

<!-- gh-comment-id:1740519767 --> @ZPMU commented on GitHub (Sep 29, 2023): 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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/pathcopycopy#170
No description provided.