Last active
May 21, 2019 13:09
-
-
Save LK64076007A/30ed6c4c52e36978540b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// This script is specifically designed to be used with TextExpander for both iOS and OS X. | |
myTag = 'soitscometothis-20'; | |
var currentURL = TextExpander.pasteboardText; | |
var re = /^.*\/([A-Z0-9]{10}).*$/; | |
var found = currentURL.match(re); | |
if (!found) { | |
cleanedURL = currentURL; | |
} else { | |
asin = found[1]; | |
cleanedURL = 'http://www.amazon.com/dp/' + asin + '?tag=' + myTag; | |
} | |
TextExpander.pasteboardText = cleanedURL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment