How It Works

Like Easy Copy? Please consider contributing...

Contibute to Easy Copy

How Easy Copy Works

Easy Copy works by copying a template (pattern) to the clipboard in text format. Additionally, a template could also specify that it should be copied as HTML as well to be pasted in applications that support HTML. Here's an example of what you'll see in Firefox for the Easy Copy menu and the Copy All Tabs menu:

Easy Copy Menu

Each of the menu items in the Easy Copy menu above represents a template and each template consists of variables. The Copy All Tabs menu works exactly as the Easy Copy menu, except that templates are generated from all open tabs.

Any template can be modified, reordered, disabled or deleted at any time from the options dialog. You can also create your own templates.

For all the examples to follow, we'll use Leonardo da Vinci's page at Wikipedia.

Templates

Templates define patterns for what's going to be copied to the clipboard. For example, you could have a template that displays the page's title and URL:

The title is: %title% and the URL is: %url%

When Easy Copy is used on Leonardo da Vinci's Wikipedia page, the template above will copy the following to the clipboard

The title is: Leonard da Vinci and the URL is: http://en.wikipedia.org/wiki/Leonardo_da_vinci

The text between % signs are called variables. Easy Copy comes with a number of defined variables and this list will expand over time. See Variables below for a list of all variables.

By default, templates that use %title% and %url% (such as Title Link) are configured to copy based on what you've selected (a handy idea borrowed from Make Link).

* If you've selected text, then the selected text and the page's URL are copied.

* If you've right-clicked on a link, then the link text and URL is copied.

* Otherwise, the page's title and link are copied.

These can be changed at any time by using specific variables such as %page_title%, %page_url%, %link_title% and %link_url%. See the list of variables below for more details.

Here's a list of built-in templates. You can always add your own templates or disable/delete existing ones.

Variables

Variables are used to describe templates and are little bits of information that can be strung together to copy something useful to the clipboard. For example, one variable represents the currently selected text and another the URL of the current page.

Variables are enclosed in % signs, eg. %selection% and the variable's name can contain letters and an underscore.

Here's a list of variables that Easy Copy supports. NB: Make sure you use the version of Easy Copy that supports the variable by looking at the Since Version column (a blank column means it's supported since the first version, ie. v1.0.0).

Variable Name

date

date_time

html_source

image_alt_text

image_source_url

link_title

link_url

links_text

links_html

page_text_content

page_title

page_url

prompt

selection

time

title

url

url_full_path

Description

Today's date in the Long Date format of the your machine.

Today's date and time in the Long Date and Time format of your machine.

HTML source of either the current selection or the whole document:

If you've selected something then it returns the selection's HTML source.

In all other cases it returns the whole document's HTML source.

The alternative text of the image that you've right-clicked over, as defined in the <img alt="..."> attribute. Returns blank if the mouse isn't hovering over an image or if the image doesn't have a src attribute.

Note: Images that come from a CSS background-image attribute will just return blanks as Firefox handles them in a different way to images loaded from the <img> tag. Easy Copy won't support these images since Firefox doesn't handle them the same either, eg. if you right-click on an <img> image, you get the Firefox menu item View Image Info. For CSS images, this item doesn't appear.

The source URL of the image that you've right-clicked over, as defined in the <img src="..."> attribute. Returns blank if the mouse isn't hovering over an image or if the image doesn't have an alt attribute.

Note: Images that come from a CSS background-image attribute will just return blanks as Firefox handles them in a different way to images loaded from the <img> tag. Easy Copy won't support these images since Firefox doesn't handle them the same either, eg. if you right-click on an <img> image, you get the Firefox menu item View Image Info. For CSS images, this item doesn't appear.

The title of the link that you've right-clicked over. If the mouse isn't hovering over a link then this defaults to a blank string.

The target URL of the link that you've right-clicked over (ie. Link Location). If the mouse isn't hovering over a link then this defaults to a blank string.

A list of links on the page, formatted as text and each on a separate line. The links returned are based on the context:

If you've selected text, only links that appear in the selected text are returned.

In all other cases, all links on the page are returned.

Links include links to other sites and download links such as PDFs and video files. Other variables can be used before and after this variable.

A list of links on the page, formatted as HTML and each on a separate line. The links returned are based on the context:

If you've selected text, only links that appear in the selected text are returned.

In all other cases, all links on the page are returned.

The title of the link is taken from the first available part depending on its title, accessibility text or image title (if the link is an image).

Links include links to other sites and download links such as PDFs and video files. Other variables can be used before and after this variable.

The entire content of the page as text (not HTML), similar to selecting the entire page and copying as text.

The text will be formatted according to the layout of the document, eg. paragraphs, indents, etc. It does not contain any other formatting such as bold, colours, images, etc.

Handy if you're using Copy All Tabs and want the entire contents of all the tabs.

The title of the page that you normally see in the browser tab, eg. Leonardo da Vinci - Wikipedia, the free encyclopedia. To keep the title clean, Easy Copy can remove "- Wikipedia, the free encyclopedia" from the end of the title. You can enable this behaviour by changing the Formatting options.

The page's URL that you see in the address bar, eg. http://en.wikipedia.org/wiki/Leonardo_da_vinci.

Prompts you for some text and then adds that text to the template. Useful for copying links to a site that you want to describe yourself, eg. for pasting in an email.

The text that's currently selected. If nothing is selected then this defaults to a blank string.

Today's time in the Long Time format of your machine.

A title that returns a different value based on the context:

If you've selected something then it returns the selected text (see selection).

If you've right-clicked over a link then it's the link's title (see link_title).

Otherwise it returns the current page's title (see page_title).

Returns a URL based on the context:

If you've right-clicked on a link then it returns the link's target URL (see link_url).

In all other cases it copies the current page's URL (in the address bar). See page_url.

Returns the full path of the page's URL, ie. the part after the domain. This consists of the URL path, query string and fragment. See examples.

Note: The frontslash (/) after the domain is always omitted. You can choose to manually add the frontslash to your templates or leave it as is.

Unlike %url% this always works on the page's URL and not on links.

Context

Always available

Always available

Always available

Always available

Always available

Right-clicked over a link

Right-clicked over a link

Always available

Always available

Always available

Always available

Always available

Always available

Something selected

Always available

Always available

Always available

Always available

Since Version

v2.6.0

v2.6.0

v2.2.0

v2.2.0

v2.4.0

v1.1.0

v2.7.0

Example

23 August 2011

23 August 2011 13:43:45

Leonardo da Vinci

http://en.wikipedia.org/wiki/Leonardo_da_vinci

...

http://en.wikipedia.org/wiki/Notary

http://en.wikipedia.org/wiki/Florence

http://en.wikipedia.org/wiki/Verrocchio

...

...

notary

Florence

Verrocchio

...

Leonardo da Vinci

http://en.wikipedia.org/wiki/Leonardo_da_vinci

13:43:45

See page_title, link_title and selection.

http://en.wikipedia.org/wiki/Leonardo_da_vinci

wiki/Leonardo_da_vinci

wiki/Leonardo_da_vinci#Personal_life

wiki/Leonardo_da_vinci?printable=yes&title=Leonardo_da_Vinci#Drawings