Created
July 5, 2023 01:36
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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