GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Copy the current path to the clipboard



The button below copies the lister's current path to the clipboard.

If you want to copy the paths of selected folders and/or filenames instead, please see here instead:

Directory Opus 10 & above:

The button is part of the default configuration, in the Edit -> Copy Other menu.

It uses the same command as mentioned for Opus 9, below, but is already there for you to use it.

Directory Opus 9:

The button uses the Clipboard SET command which was new to Opus 9. The command is:

Clipboard SET {sourcepath$|noterm}

Here's the full button which you can copy to the clipboard and then paste into your toolbar. (To do this, enter Customize mode, then right-click some empty space on the toolbar and select Paste.)

<?xml version="1.0"?>
<button display="both">
	<label>Copy Folder Path</label>
	<function type="normal">
		<instruction>Clipboard SET {sourcepath$|noterm}</instruction>

Directory Opus 8:

Opus 8 users can do something similar by replacing both lines with this alternative command:

@runmode hide
SetClip.exe {sourcepath$|noterm}

You will need to get my SetClip utility if you don't have it already. Opus 9 users do not need SetClip.exe as a similar command is now built-in to Opus.

Two questions about clipboard set
How to copy the lister folder name?
Clipboard COPYNAMES doesn't work anymore with current folder
Copy filenames from empty directory?

thanks alot for the script above. Is there a way to get this to work with Collections. ie. to copy the original file path and not the path to the collection the path is in.



If you want the parent folder of the selected file:

@nofilenamequoting Clipboard SET {filepath$|..}


Is there a way to make this work in flat mode?


I'm not sure which of the things you mean, but they should all work in Flat View mode already.


When I am doing it, it only copy the path from the location where I started the Flat View Mode. It doesn't use the actual location of the file inside the subfolders. Maybe I am doing something wrong?


Which of the different commands discussed in this thread is the one you are using?


Please allow me to step in here having a question that may be related to this subject.

Following scenario

I have a number of folders and subfolders
using a button : Set FLATVIEW=Toggle,MixedNoFolders
only files may be displayed in the right window panel

a) selecting all files, then Edit->Copy Other->Complete Folder Listing
b) select all and Print FOLDER=selected TO=clip Quiet (in my context menu)

obviously will print the contents of 1 folder only (top one)

In this case I use Tools->Print Folder Contents - tag 'Flat View' [Mixed] - to Clipboard as a 'workaround'
(ref thread 'Clipboard' Copy filenames + modified times to clipboard)

I am not sure though if there is a : 'Print .??.=selected to clip quiet' that does the same as Tools->Print Folder.



I'm not sure exactly what you want (have only had time to look at this thread very quickly) but you should be able to do it using the Print command and its FLATVIEW argument, I think.