Skip to content

Instantly share code, notes, and snippets.

@yoshimov
Created November 26, 2008 09:20
Show Gist options
  • Save yoshimov/29333 to your computer and use it in GitHub Desktop.
Save yoshimov/29333 to your computer and use it in GitHub Desktop.
Paste quoted text and url to current cursor position.
CmdUtils.CreateCommand({
name: "paste-quoted-text-and-url",
description: "Paste quoted text and url to current cursor position.",
icon: "http://yoshimov.com/favicon.ico",
homepage: "http://yoshimov.com",
author: { name: "Yoshimov", email: "yoshimov@pobox.com"},
preview: "Paste quoted text and url to current corsor position",
execute: function(){
var d = Application.activeWindow.activeTab.document;
var st = '"' + d.getSelection() + '" ';
var text = st + d.location.href;
var opt = {text: text};
CmdUtils.setSelection(text, opt);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment