Repository navigation
How to get only filename using Copy to clipboard? #597
|
When I right click on an image it will save the full path name to the clipboard. Is there a way to save only the filename? Using 0.4.1 on Mac. I checked in Settings and I do not see anything there to help. I often select a whole bunch of files (could be hundreds) and then I want to save the filenames to the clipboard. I have a specific use for this, but I can only seem to get the full pathname. Yes, I realize that with editing I can remove all the path and leave only the filename, but for hundreds of files that is very tedious. And maybe some sort of script or something in an editor could sort of automate it. Not sure. But I wish there was an option in Lap to just get the filenames. And also if there was an option for them to be in a single space separated list rather than each on a separate line then that would be even better. :-) |
Replies: 1 comment 2 replies
|
Hi @bakubo There is no setting for this in 0.4.1. Copy file path always puts the full paths on the clipboard, one per line. The shortcut for it is ⌥⌘C. On a Mac you can strip the folders in one step. Select your files in Lap and press ⌥⌘C. Then run this in Terminal. pbpaste | sed 's#.*/##' | paste -sd ' ' - | pbcopyYour clipboard now has only the filenames on one line with spaces between them. If you want one per line instead, drop the paste part. pbpaste | sed 's#.*/##' | pbcopyOne thing to watch. If any of your filenames have spaces in them, the space separated list will be hard to split later. The one per line version avoids that. |
Hi @bakubo
There is no setting for this in 0.4.1. Copy file path always puts the full paths on the clipboard, one per line. The shortcut for it is ⌥⌘C.
On a Mac you can strip the folders in one step. Select your files in Lap and press ⌥⌘C. Then run this in Terminal.
Your clipboard now has only the filenames on one line with spaces between them. If you want one per line instead, drop the paste part.
One thing to watch. If any of your filenames have spaces in them, the space separated list will be hard to split later. The one per line version avoids that.