Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edcottrell/e0abf13a09aab6932bc4ed721ccdd368 to your computer and use it in GitHub Desktop.
Save edcottrell/e0abf13a09aab6932bc4ed721ccdd368 to your computer and use it in GitHub Desktop.
TextExpander Snippet to Paste Excel Values without Excess Quotation Marks (Leading, Trailing, or Doubled)
// Start with the clipboard content
var result = TextExpander.pasteboardText;
// If the result is wrapped in quotation marks...
if (result.match(/^"[\s\S]+"$/)) {
result = result.replace(/^"|"$/g, '') // Strip the leading and trailing quotation marks
.replace(/""/g, '"'); // And replace any doubled quotation marks ('""') with just one ('"')
}
// Return the result
TextExpander.appendOutput(result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment