Clipboard

The Clipboard internal command can be used to:

 

Command Arguments:

Argument

Type

Possible values

Description

ADD

/S

(no value)

Adds additional files to those already on the clipboard instead of replacing them. It is used in conjunction with COPY or CUT. This lets you place multiple items on the clipboard from different source folders, and then paste them into the desired destination folder in one go.

Example: Clipboard COPY ADD

AS

/K

<filename>

Overrides the default filename used when pasting images or text to disk. Normally when you paste clipboard image data, Opus creates a file called Clipboard Image.png (or another suffix, depending on the file format), and when you paste text data, Opus creates a file called Clipboard Text.txt. Use this argument to change the filename. The default file extension will applied automatically.

This argument can also be used when pasting the clipboard contents as an archive (e.g. with Clipboard PASTE=zip). In this case the filename for the archive is normally generated automatically from the clipboard contents - this argument lets you override it.

Example: Clipboard PASTE AS PastedData

 

 

ask

When pasting image or text data to a file, this argument causes Opus to prompt you for a name for the created file, and in the case of image data, the image format to use.

Paste As.png

 

This argument can also be used when pasting the clipboard contents as an archive (e.g. with Clipboard PASTE=7z). In this case you will be prompted for the name of the new archive and any archive format-specific parameters. 


Example: Clipboard PASTE AS=ask

COPY

/S

(no value)

Copies all selected files and folders to the clipboard.

Example: Clipboard COPY

COPYNAMES

/O

(no value)

Copies the names of all selected files and folders to the clipboard (the file names themselves are copied, in text format, rather than the actual files).

The default format (with no value specified) copies the full path and filename of all selected items to the clipboard, with one file on each line. For example,

C:\Windows\notepad.exe
C:\Windows\regedit.exe


The various values for the COPYNAMES argument let you modify the format filenames are copied in. Some values can be combined - see the examples given below for ideas on what you can do. Also see the REGEXP argument which lets you control the format yourself using regular expressions.

Example: Clipboard COPYNAMES

 

 

nopaths

Copies just the names of selected items to the clipboard - the paths are not copied. For example,

notepad.exe
regedit.exe


Example: Clipboard COPYNAMES=nopaths

 

 

url

Copies the names of selected items to the clipboard in URL format. For files on an FTP site this will result in an ftp:// style path that should be accepted by other FTP programs. For local files, filenames will be copied as file:// style links (e.g. file:///C:/Windows). For example,

file:///C:/Windows/notepad.exe
file:///C:/Windows/regedit.exe


Example:
ClipboardCOPYNAMES=url

 

 

hash

Copies the filename of each selected file along with its MD5 checksum. For example,

notepad.exe : f2c7bb8acc97f92e987a2d4087d021b1
regedit.exe : 2e2c937846a0b8789e5e91739284d17a


Example: Clipboard COPYNAMES=hash

 

 

hash2

Copies the MD5 checksum of selected files in an alternative format, one compatible with the venerable MD5Sum utility. For example,

f2c7bb8acc97f92e987a2d4087d021b1 *notepad.exe
2e2c937846a0b8789e5e91739284d17a *regedit.exe


Example: Clipboard COPYNAMES=hash2

 

 

hash3

Copies the MD5 checksum of selected files without the filenames. You would probably only want to use this format on a single file at a time. For example,

f2c7bb8acc97f92e987a2d4087d021b1
2e2c937846a0b8789e5e91739284d17a


Example: Clipboard COPYNAMES=hash3

 

 

hash4

Copies the filename of each selected file along with its SHA-1 checksum. For example,

notepad.exe : 7eb0139d2175739b3ccb0d1110067820be6abd29
regedit.exe : f48138dc476e040b8a9925c7d2650b706178e863


Example: Clipboard COPYNAMES=hash4

 

 

hash5

Copies the SHA-1 checksum of selected files in an alternative format. For example,

7eb0139d2175739b3ccb0d1110067820be6abd29 *notepad.exe
f48138dc476e040b8a9925c7d2650b706178e863 *regedit.exe


Example: Clipboard COPYNAMES=hash5

 

 

hash6

Copies the SHA-1 checksum of selected files without the filenames. You would probably only want to use this format on a single file at a time. For example,

7eb0139d2175739b3ccb0d1110067820be6abd29
f48138dc476e040b8a9925c7d2650b706178e863


Example: Clipboard COPYNAMES=hash6

 

 

unc

When the unc value is specified, and the files whose names are being copied reside on a mapped network drive, the function will resolve their mapped paths to a UNC path and copy that to the clipboard instead. For example, if Z: were a mapped network drive, Clipboard COPYNAMES would return:

Z:\Windows\notepad.exe
Z:\Windows\regedit.exe

Whereas Clipboard COPYNAMES=unc might return:

\\win7vm\c\Windows\notepad.exe
\\win7vm\c\Windows\regedit.exe

If the current folder is not on a mapped network drive, the unc argument has no effect.

Example: Clipboard COPYNAMES=unc

 

 

short

Copies the short (8.3) filenames of selected files, rather than their long filenames. For example,

C:\PROGRA~1\GPSOFT~1\DIRECT~1\dopus.exe
C:\PROGRA~1\GPSOFT~1\DIRECT~1\dopuslib.dll


Example: Clipboard COPYNAMES=short,nopaths

 

 

single

When multiple files are selected, this will copy all the names on a single line (separated by spaces) rather than one item per line. If any item names contain a space, they will be surrounded by quotation marks. For example,

dopus.exe dopuslib.dll "Opus 10 What's New.pdf"


Example: Clipboard COPYNAMES=nopaths,single

 

 

path

Copies just the path of selected items, without the filenames (the opposite of nopaths). For example,

C:\Program Files\GPSoftware\Directory Opus


Example: Clipboard COPYNAMES=path

 

 

capsemantics

Makes the function behave like the Windows Copy as path context menu command (one file path per line, and lines are always quoted).

Example: Clipboard COPYNAMES=capsemantics

COPYQUEUE

/O

(no value)

Use in conjunction with the PASTE argument to paste files with copy queuing enabled. With no value specified, copies will be queued automatically if required. This can override the Automatically manage file copy queues option on the File Operations / Copy Options Preferences page.

Example: Clipboard PASTE COPYQUEUE

 

 

<queue name>

When you specify a queue name as the value for this argument, it enables manual copy queuing when pasting files. That is, with a name specified, file pastes will always be queued to the specified queue - if no name is specified for the argument, pastes will only be queued if needed.

Example: Clipboard PASTE COPYQUEUE=MyQueue

 

 

none

Used to disable copy queuing - whether enabled in Preferences, or otherwise enabled by the shift keyword.

Example: Clipboard PASTE COPYQUEUE=none

 

 

shift

Lets you specify two alternate parameters for the COPYQUEUE argument. The value specified before the shift keyword is used if the Shift key is not held down - the value after it is used if it is. For example, you could configure a paste button to queue files to a specific queue if the Shift key were held down, and to disable queuing otherwise.

Example: Clipboard PASTE COPYQUEUE=none,shift,MyQueue

 

 

quiet

Specify the quiet keyword to suppress the prompt that normally indicates a copy operation has been queued.

Example: Clipboard PASTE COPYQUEUE=MyQueue,quiet

CUT

/S

(no value)

Cuts all selected files and folders to the clipboard (nothing happens to the files immediately, but when you paste them somewhere else they are moved rather than copied).

Example: Clipboard CUT

EXPANDNEWLINES

/S

(no value)

Used with Clipboard SET, allows you to use \n to insert a new line into the string, so that you can set a clipboard string consisting of multiple lines. You can also use \\ to insert a literal backslash.

Example: Clipboard EXPANDNEWLINES SET Hello\nWorld

When inserting paths into the clipboard string while using EXPANDNEWLINES, you should use escbackslash to prevent the backslashes in the paths from being misinterpreted.

Example (all on one line):
 Clipboard EXPANDNEWLINES SET {sourcepath|escbackslash}\n{destpath|escbackslash}

NEWLINEIFADDING

/S

(no value)

Used with Clipboard ADD SET, adds a new line between the existing clipboard data and the string to be added. If the clipboard is currently blank or has non-text data then the new line is not added.

Example: Clipboard ADD NEWLINEIFADDING SET This is a new line.

NOFROMFOCUS

/S

(no value)

The default behaviour for the Clipboard command is to operate on either the source file display, or the Folder Tree, depending on which one has the input focus. This lets you use the same command to copy folders in the tree as well as files in the file display. Specify this argument to force the command to always operate on the source file display and ignore the folder tree.

Example: Clipboard COPY NOFROMFOCUS

PASTE

/O

(no value)

Pastes any files and folders previously copied to the clipboard into the current Lister. If the files were placed on the clipboard by a "cut" operation they will be moved, otherwise they will be copied to the new location.

Example: Clipboard PASTE

 

 

jpg

Forces image data on the clipboard to be pasted in JPEG format (overriding the Preferences default setting). You can also specify the JPEG image quality.

Example: Clipboard PASTE=jpg:85

 

 

png

Pastes image data in PNG format.

Example: Clipboard PASTE=png

 

 

gif

Pastes image data in GIF format.

Example: Clipboard PASTE=gif

 

 

bmp

Pastes image data in BMP format.

Example: Clipboard PASTE=bmp

 

 

zip

Pastes clipboard contents (files, image or text data) as a new ZIP archive. The filename of the archive will be generated automatically from the clipboard contents - you can override this with the AS argument.

 

 

7z

Pastes clipboard contents as a new 7Zip archive.

 

 

<archive suffix>

Pastes clipboard contents as a new archive of the specified type (you can specify any archive suffix that Opus supports creation of).

PASTELINK

/O

(no value)

Pastes shortcuts to any files and folders previously copied to the clipboard into the current Lister. For example, if you use the Clipboard COPY command on the C:\Windows folder, navigate to another folder, and run the Clipboard PASTELINK command, it would paste a shortcut called Windows - Shortcut.lnk.

Example: Clipboard PASTELINK

 

 

junction

Creates a junction to any folders that are on the clipboard. Junctions are only supported on NTFS volumes, and you can not create junctions to files - only folders.

Example: Clipboard PASTELINK=junction

 

 

hardlink

Creates a hardlink to any files that are on the clipboard. Hardlinks are only supported on NTFS volumes, and you can not create hardlinks to folders - only to files.

Example: Clipboard PASTELINK=hardlink

 

 

softlink

Creates a softlink to any files or folders that are on the clipboard. Note that the link target is stored as an absolute path. Soft links support both files and folders, but are only supported on Vista and above (and again, only on NTFS volumes). Creating a softlink requires administrator access so Opus will display a UAC prompt if necessary when you run this command.

Example: Clipboard PASTELINK=softlink

 

 

relsoftlink

Creates a softlink to any files or folders that are on the clipboard, storing a relative target path if possible. A regular absolute link will be created if the target can not be expressed relative to the link.

Example: Clipboard PASTELINK=relsoftlink

 

 

auto

Automatically determines the most suitable type of link to create. On Vista and above, this will be a softlink - on Windows XP, either a junction or a hardlink depending on the type of item. If a non-filesystem object is on the clipboard (e.g. you are trying to make a link to a virtual folder like the Control Panel) or the target drive is not formatted with NTFS then it will create a shortcut.

Example: Clipboard PASTELINK=auto

 

 

autonosoft

Does the same as auto except that it will not try to create softlinks. In other words: It will create either a junction or a hardlink depending on the type of item. If a non-filesystem object is on the clipboard (e.g. you are trying to make a link to a virtual folder like the Control Panel) or the target drive is not formatted with NTFS then it will create a shortcut.

Example: Clipboard PASTELINK=autonosoft

PREFERIMAGE

/S

(no value)

When pasting data from the clipboard into a new file, image data is normally given priority over text data. Opus makes an exception to this rule in certain situations.

For example, if you use Microsoft Excel and copy some cells to the clipboard, Excel puts both the text from the cells and a screenshot of them into the clipboard. When pasting data from Excel, people usually want the text, not the screenshot. Accordingly, when Opus detects that pasted data is from Excel it gives text priority over images, contrary to its behaviour with data from other programs.

If the PREFERIMAGE argument is specified, image data will always be given priority over text data, regardless of where the data came from. This allows you to paste the image data from Excel, if that's what you want. (You'll still get a text file if there is only text data on the clipboard.)

Example: Clipboard PASTE PREFERIMAGE

PREFERTEXT

/S

(no value)

When pasting data from the clipboard into a new file, image data is normally given priority over text data. (There are exceptions to this rule; see the PREFERIMAGE argument, above.)

Normally, if another program puts both text and image data into the clipboard and you then paste into an Opus to save the data as a new file, the text data will be ignored and you'll get an image file (BMP, JPG, GIF or PNG).

For example, a paint program may place both a photo and a description of the photo into the clipboard, and pasting into Opus would normally create an image file containing the photo, not a text file containing the description.

The PREFERTEXT argument gives text priority over images, so you'll get a text file in that situation instead. (You'll still get an image file if there is only image data on the clipboard.)

Example: Clipboard PASTE PREFERTEXT

REGEXP

/K/M

<search> <replace> ...

In conjunction with COPYNAMES lets you perform regular expression manipulation on the filenames as they are put into the clipboard - effectively letting you determine your own clipboard format.

The values specified for this argument are one or more pairs of strings - the first of each pair is the pattern to search for, and the second of each pair is the replace string. For example, to strip off the suffixes of all filenames when they are copied to the clipboard, the search string would be (.*)\.(.*) and the replacement string would be \1.

Example: Clipboard COPYNAMES=nopaths REGEXP "(.*)\.(.*)" "\1"

SET

/K/R

user defined

Copies the supplied text to the clipboard.

Example: Clipboard SET {sourcepath}

USESEL

/S

(no value)

Modifies the behaviour of the PASTE and PASTESHORTCUT functions. Normally files are pasted into the current source folder. If you specify the USESEL argument and a sub-folder is currently selected in the source file display, the files will be pasted into that sub-folder. This is most useful when used as a context menu command (so that you can right-click on a folder and paste the clipboard contents into it).

This also works with archives that Opus can write to - for example, if you add the following command to the context menu for the Archives File type Group then you can right-click on an existing archive file and paste the clipboard contents directly into it.

Example: Clipboard PASTE USESEL