How to copy file path in the current tab?

Questions, glitches, bugs and crashes
Locked
rail4you
Posts: 42
Joined: Wed Dec 13, 2017 2:06 pm

How to copy file path in the current tab?

Post by rail4you » Wed Mar 14, 2018 11:09 am

I often open folders as tabs and want to copy the file path of the tab.

NC has two commands: copy file name and copy file path. The commands all copy the selected files path or name. I can't find an easy way to copy the tab path.

I hope there is a command "copy path" in the context menu of the tab. Adding "Copy file path in the File tab" command is nice too, so I can set hotkey to use it, "cmd+option+shift+c" is a good default hotkey.

User avatar
mike
Posts: 1060
Joined: Thu Jul 16, 2015 5:35 am
Location: Exeter, UK

Re: How to copy file path in the current tab?

Post by mike » Thu Mar 15, 2018 2:37 am

Ok, I initially thought that copying ".." will do, but apparently this codepath is not implemented.
It seems to me that adding yet another hotkey is an overkill here and Alt+Cmd+C on ".." would be sufficient enough.

rail4you
Posts: 42
Joined: Wed Dec 13, 2017 2:06 pm

Re: How to copy file path in the current tab?

Post by rail4you » Thu Mar 15, 2018 5:09 am

".." is the parent folder of the current tab. I wish there are more actions of ".." folder too. Currently, dragging files(very useful), copying names is not allowed in "..". Dragging file into ".." is a good way to copy or extract files to the parent folder.

Copy file path in the current tab is very important for automation and Forklift and other commander like applications already have this feature.
If I can use hotkey to get the tab path, the path can be used in many other applications. For example, I can use default folder x to set the folder in NC as the default save folder(using some applescripts).

Another Hotkey is the solid method to get the path. "cmd+option+c" needs selecting ".." first.

JayB
Posts: 192
Joined: Sun Jan 08, 2017 4:38 pm

Re: How to copy file path in the current tab?

Post by JayB » Sun Apr 22, 2018 10:27 am

In the main dropdown menu "Command" it could be done by pressing ALT, and then you have something like "Copy Folder Name" and "Copy Folder Path".

But if it's mainly for automation, you can add two simple Unix commands at the beginning of your automation scripts, e.g.

Code: Select all

for file in ${@}
do
	parent_path=$(dirname "$file")
	parent_name=$(basename "$parent_path")
	# your automation script
done
or you can just add two small scripts where you echo and pbcopy the variable of your choice, i.e.

Code: Select all

echo -n "$parent_path" | pbcopy
# or
echo -n "$parent_name" | pbcopy
then add these as Tools in NC preferences and assign keyboard shortcuts. It wouldn't work as fast as a direct implementation, though.

And it wouldn't work directly on the ".." object. (That would need to be implemented, I agree.)

rail4you
Posts: 42
Joined: Wed Dec 13, 2017 2:06 pm

Re: How to copy file path in the current tab?

Post by rail4you » Wed Apr 25, 2018 12:29 pm

Thank you, this is a really smart idea. The custom tool is powerful enough.

Locked