├── .appcast.xml ├── .gitignore ├── Fast Text Transfer.sketchplugin └── Contents │ ├── Resources │ └── Icons │ │ ├── fast-copy-text.png │ │ ├── fast-paste-text.png │ │ └── fast-swap-text.png │ └── Sketch │ ├── System │ └── ga.cocoascript │ ├── Text │ ├── fast-copy-text.cocoascript │ ├── fast-paste-text.cocoascript │ └── fast-swap-text.cocoascript │ └── manifest.json ├── LICENSE ├── README.md └── docs ├── cover.png ├── download.png ├── fast-copy-text-demo.gif ├── fast-copy-text-icon.png ├── fast-paste-text-demo.gif ├── fast-paste-text-icon.png ├── fast-swap-text-demo.gif ├── fast-swap-text-icon.png ├── paypal.png └── runner-pro.png /.appcast.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fast Text Transfer 5 | https://raw.githubusercontent.com/jbentzen/sketch-fast-text-transfer/master/.appcast.xml 6 | Lightning fast copying, pasting and swaping text. 7 | en 8 | 9 | Release v1.0.0 10 | Inital release. 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### macOS 2 | 3 | # General 4 | .DS_Store 5 | .AppleDouble 6 | .LSOverride 7 | .localized 8 | 9 | # Icon must end with two \r 10 | Icon 11 | 12 | 13 | # Thumbnails 14 | ._* 15 | 16 | # Files that might appear in the root of a volume 17 | .DocumentRevisions-V100 18 | .fseventsd 19 | .Spotlight-V100 20 | .TemporaryItems 21 | .Trashes 22 | .VolumeIcon.icns 23 | .com.apple.timemachine.donotpresent 24 | 25 | # Directories potentially created on remote AFP share 26 | .AppleDB 27 | .AppleDesktop 28 | Network Trash Folder 29 | Temporary Items 30 | .apdisk 31 | -------------------------------------------------------------------------------- /Fast Text Transfer.sketchplugin/Contents/Resources/Icons/fast-copy-text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbentzen/sketch-fast-text-transfer/62195c49f108f6848964bc4f918c5e2512d29865/Fast Text Transfer.sketchplugin/Contents/Resources/Icons/fast-copy-text.png -------------------------------------------------------------------------------- /Fast Text Transfer.sketchplugin/Contents/Resources/Icons/fast-paste-text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbentzen/sketch-fast-text-transfer/62195c49f108f6848964bc4f918c5e2512d29865/Fast Text Transfer.sketchplugin/Contents/Resources/Icons/fast-paste-text.png -------------------------------------------------------------------------------- /Fast Text Transfer.sketchplugin/Contents/Resources/Icons/fast-swap-text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbentzen/sketch-fast-text-transfer/62195c49f108f6848964bc4f918c5e2512d29865/Fast Text Transfer.sketchplugin/Contents/Resources/Icons/fast-swap-text.png -------------------------------------------------------------------------------- /Fast Text Transfer.sketchplugin/Contents/Sketch/System/ga.cocoascript: -------------------------------------------------------------------------------- 1 | // Analytics 2 | function ga(context, trackingID, eventCategory, eventAction, eventLabel, eventValue) { 3 | 4 | var uuidKey = "google.analytics.uuid"; 5 | var uuid = NSUserDefaults.standardUserDefaults().objectForKey(uuidKey); 6 | if (!uuid) { 7 | uuid = NSUUID.UUID().UUIDString(); 8 | NSUserDefaults.standardUserDefaults().setObject_forKey(uuid, uuidKey); 9 | } 10 | 11 | var appName = encodeURI(context.plugin.name()), 12 | appId = context.plugin.identifier(), 13 | appVersion = context.plugin.version(); 14 | 15 | var url = "https://www.google-analytics.com/collect?v=1"; 16 | // Tracking ID 17 | url += "&tid=" + trackingID; 18 | // Source 19 | url += "&ds=sketch" + MSApplicationMetadata.metadata().appVersion; 20 | // Client ID 21 | url += "&cid=" + uuid; 22 | // User GEO location 23 | url += "&geoid=" + NSLocale.currentLocale().countryCode(); 24 | // User language 25 | url += "&ul=" + NSLocale.currentLocale().localeIdentifier().toLowerCase(); 26 | // pageview, screenview, event, transaction, item, social, exception, timing 27 | url += "&t=event"; 28 | // App Name 29 | url += "&an=" + appName; 30 | // App ID 31 | url += "&aid=" + appId; 32 | // App Version 33 | url += "&av=" + appVersion; 34 | // Event category 35 | url += "&ec=" + encodeURI(eventCategory); 36 | // Event action 37 | url += "&ea=" + encodeURI(eventAction); 38 | // Event label 39 | if (eventLabel) { 40 | url += "&el=" + encodeURI(eventLabel); 41 | } 42 | // Event value 43 | if (eventValue) { 44 | url += "&ev=" + encodeURI(eventValue); 45 | } 46 | 47 | var session = NSURLSession.sharedSession(); 48 | var task = session.dataTaskWithURL(NSURL.URLWithString(NSString.stringWithString(url))); 49 | task.resume(); 50 | 51 | } 52 | -------------------------------------------------------------------------------- /Fast Text Transfer.sketchplugin/Contents/Sketch/Text/fast-copy-text.cocoascript: -------------------------------------------------------------------------------- 1 | // Imports 2 | @import "../System/ga.cocoascript"; 3 | 4 | // On Run 5 | var onRun = function(context) { 6 | 7 | // Setup 8 | var doc = context.document; 9 | var selection = context.selection; 10 | var selectionHasTextLayer = false; 11 | 12 | // Check Selection 13 | if (selection.count() == 1) { 14 | var loop = selection.objectEnumerator(); 15 | while (layer = loop.nextObject()) { 16 | if (layer.class() == "MSTextLayer") { 17 | selectionHasTextLayer = true; 18 | 19 | // Get string 20 | var string = layer.stringValue(); 21 | 22 | // Copy string 23 | var pasteboard = NSPasteboard.generalPasteboard(); 24 | pasteboard.clearContents(); 25 | pasteboard.writeObjects([string]); 26 | 27 | // Finish 28 | doc.showMessage("Text copied"); 29 | 30 | } 31 | } 32 | 33 | // No text layer selected 34 | if (!selectionHasTextLayer) { 35 | doc.showMessage("Your selection contains no text layer"); 36 | } 37 | 38 | } else { 39 | 40 | // No text layer selected 41 | doc.showMessage("Please select a text layer"); 42 | } 43 | 44 | // Stats 45 | ga(context, "UA-114431439-1", "Text", context.command.identifier()); 46 | 47 | }; 48 | -------------------------------------------------------------------------------- /Fast Text Transfer.sketchplugin/Contents/Sketch/Text/fast-paste-text.cocoascript: -------------------------------------------------------------------------------- 1 | // Imports 2 | @import "../System/ga.cocoascript"; 3 | 4 | // On Run 5 | var onRun = function(context) { 6 | 7 | // Setup 8 | var doc = context.document; 9 | var selection = context.selection; 10 | var selectionHasTextLayer = false; 11 | 12 | // Get string 13 | var string = NSPasteboard.generalPasteboard().stringForType(NSPasteboardTypeString); 14 | 15 | // Check Selection 16 | if (selection.count() > 0) { 17 | var loop = selection.objectEnumerator(); 18 | while (layer = loop.nextObject()) { 19 | if (layer.class() == "MSTextLayer") { 20 | selectionHasTextLayer = true; 21 | 22 | // Set string 23 | layer.setStringValue(string); 24 | 25 | // Finish 26 | doc.showMessage("Text pasted"); 27 | } 28 | } 29 | 30 | // No text layer(s) selected 31 | if (!selectionHasTextLayer) { 32 | doc.showMessage("Your selection contains no text layer(s)"); 33 | } 34 | 35 | } else { 36 | 37 | // No text layer selected 38 | doc.showMessage("Please select a text layer"); 39 | } 40 | 41 | // Stats 42 | ga(context, "UA-114431439-1", "Text", context.command.identifier()); 43 | 44 | }; 45 | -------------------------------------------------------------------------------- /Fast Text Transfer.sketchplugin/Contents/Sketch/Text/fast-swap-text.cocoascript: -------------------------------------------------------------------------------- 1 | // Imports 2 | @import "../System/ga.cocoascript"; 3 | 4 | // On Run 5 | var onRun = function(context) { 6 | 7 | // Setup 8 | var doc = context.document; 9 | var selection = context.selection; 10 | var selectionHasTextLayer = false; 11 | var strings = []; 12 | 13 | // Check Selection 14 | if (selection.count() == 2) { 15 | var loop = selection.objectEnumerator(); 16 | while (layer = loop.nextObject()) { 17 | if (layer.class() == "MSTextLayer") { 18 | selectionHasTextLayer = true; 19 | 20 | // Collect stringslis 21 | strings.push(layer.stringValue()); 22 | } 23 | } 24 | 25 | // Check strings 26 | if (strings.length == 2) { 27 | var i = strings.length-1; 28 | loop = selection.objectEnumerator(); 29 | while (layer = loop.nextObject()) { 30 | layer.setStringValue(strings[i]); 31 | i--; 32 | } 33 | 34 | // Finish 35 | doc.showMessage("Text swapped"); 36 | 37 | } else { 38 | 39 | // No text layers selected 40 | doc.showMessage("Please select two text layers"); 41 | } 42 | 43 | // No text layers selected 44 | if (!selectionHasTextLayer) { 45 | doc.showMessage("Your selection contains no text layers"); 46 | } 47 | 48 | } else { 49 | 50 | // No text layers selected 51 | doc.showMessage("Please select two text layers"); 52 | } 53 | 54 | // Stats 55 | ga(context, "UA-114431439-1", "Text", context.command.identifier()); 56 | 57 | }; 58 | -------------------------------------------------------------------------------- /Fast Text Transfer.sketchplugin/Contents/Sketch/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Fast Text Transfer", 3 | "description": "Lightning fast copying, pasting and swaping text.", 4 | "author": "Jesper Bentzen", 5 | "homepage": "https://github.com/jbentzen/sketch-fast-text-transfer", 6 | "appcast": "https://raw.githubusercontent.com/jbentzen/sketch-fast-text-transfer/master/.appcast.xml", 7 | "version": "1.0.0", 8 | "identifier": "com.jesperbentzen.sketch.fast-text-transfer", 9 | "compatibleVersion": "46.0", 10 | "bundleVersion": "1", 11 | "commands": [ 12 | { 13 | "name": "Fast Copy Text", 14 | "identifier": "fast_copy_text", 15 | "handler": "onRun", 16 | "shortcut": "cmd option ctrl c", 17 | "script": "Text/fast-copy-text.cocoascript", 18 | "icon": "Icons/fast-copy-text.png", 19 | "description" : "Copy text from text layer to clipboard." 20 | }, 21 | { 22 | "name": "Fast Paste Text", 23 | "identifier": "fast_paste_text", 24 | "handler": "onRun", 25 | "shortcut": "cmd option ctrl v", 26 | "script": "Text/fast-paste-text.cocoascript", 27 | "icon": "Icons/fast-paste-text.png", 28 | "description" : "Paste text from clipboard to text layer(s)." 29 | }, 30 | { 31 | "name": "Fast Swap Text", 32 | "identifier": "fast_swap_text", 33 | "handler": "onRun", 34 | "shortcut": "cmd option ctrl s", 35 | "script": "Text/fast-swap-text.cocoascript", 36 | "icon": "Icons/fast-swap-text.png", 37 | "description" : "Swap text between two text layers." 38 | } 39 | ], 40 | "menu": { 41 | "title": "Fast Text Transfer", 42 | "items": [ 43 | "fast_copy_text", 44 | "fast_paste_text", 45 | "fast_swap_text" 46 | ] 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Jesper Bentzen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Fast Text Transfer 2 | ![Fast Text Transfer](docs/cover.png) 3 | 4 | ## Introduction 5 | Fast Text Transfer is a Sketch plugin that adds lightning fast copying, pasting and swaping text. 6 | 7 | Stop wasting time "entering" text layers, selecting all text, copying or pasting text selection followed by "exiting" text layers, sometimes making a mistake and breaking things. This plugin does all that and more in a single action. It's like "copy / paste style" for text. 8 | 9 | Works with [Sketch](https://sketchapp.com) 46 or later. 10 | 11 | | ![Fast Copy Text Icon](docs/fast-copy-text-icon.png) | ![Fast Copy Text Icon](docs/fast-paste-text-icon.png) | ![Fast Copy Text Icon](docs/fast-swap-text-icon.png) | 12 | | :--- | :--- | :--- | 13 | | **Fast Copy Text** | **Fast Paste Text** | **Fast Swap Text** | 14 | | [Learn how](#fast-copy-text) | [Learn how](#fast-paste-text) | [Learn how](#fast-swap-text) | 15 | 16 | 17 | ## Installation 18 | 19 | #### Install with Runner Pro 20 | With Runner Pro for Sketch, just go to the `install` command and search for `Fast Text Transfer`. Runner Pro allows you to manage plugins and do much more to speed up your workflow in Sketch. 21 | 22 | 23 | 24 | 25 | 26 | 27 | #### Install manually 28 | 1. Download plugin. 29 | 2. Unzip downloaded archive. 30 | 3. Double-click `Fast Text Transfer.sketchplugin` to install. 31 | 4. Restart Sketch if updating. 32 | 33 | 34 | 35 | 36 | 37 | 38 | ## Usage 39 | 40 | #### Fast Copy Text 41 | 42 | Copy text from text layer to clipboard. 43 | 44 | Menu: `Plugins` > `Fast Text Transfer` > `Fast Copy Text` 45 | 46 | Shortcut: + + + c 47 | 48 | ![Fast Copy Text](docs/fast-copy-text-demo.gif) 49 | 50 | 51 | #### Fast Paste Text 52 | 53 | Paste text from clipboard to text layer(s). 54 | 55 | Menu: `Plugins` > `Fast Text Transfer` > `Fast Paste Text` 56 | 57 | Shortcut: + + + v 58 | 59 | ![Fast Paste Text](docs/fast-paste-text-demo.gif) 60 | 61 | #### Fast Swap Text 62 | 63 | Swap text between two text layers. 64 | 65 | Menu: `Plugins` > `Fast Text Transfer` > `Fast Swap Text` 66 | 67 | Shortcut: + + + s 68 | 69 | ![Fast Swap Text](docs/fast-swap-text-demo.gif) 70 | 71 | 72 | ## Releases 73 | - v1.0.0 - Initial release 74 | 75 | ## License 76 | This project is licensed under the [MIT license](LICENSE). 77 | 78 | 79 | ## Author 80 | Developed by Jesper Bentzen. 81 | 82 | - Website: [jesperbentzen.com](http://jesperbentzen.com) 83 | - Twitter: [@jbentzen](https://twitter.com/jbentzen) 84 | 85 | Star this repository if you like it, and if you find that this plugin somehow saves your day, then please consider buying me a coffee via PayPal. It will surely help motivate me to further support this plugin. :) 86 | 87 | 88 | 89 | 90 | 91 | 92 | ## Acknowledgement 93 | Thank you to the entire Sketch Developer Community and especially [@Ashung](https://github.com/Ashung) for sharing hard work to study and build upon. 94 | -------------------------------------------------------------------------------- /docs/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbentzen/sketch-fast-text-transfer/62195c49f108f6848964bc4f918c5e2512d29865/docs/cover.png -------------------------------------------------------------------------------- /docs/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbentzen/sketch-fast-text-transfer/62195c49f108f6848964bc4f918c5e2512d29865/docs/download.png -------------------------------------------------------------------------------- /docs/fast-copy-text-demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbentzen/sketch-fast-text-transfer/62195c49f108f6848964bc4f918c5e2512d29865/docs/fast-copy-text-demo.gif -------------------------------------------------------------------------------- /docs/fast-copy-text-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbentzen/sketch-fast-text-transfer/62195c49f108f6848964bc4f918c5e2512d29865/docs/fast-copy-text-icon.png -------------------------------------------------------------------------------- /docs/fast-paste-text-demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbentzen/sketch-fast-text-transfer/62195c49f108f6848964bc4f918c5e2512d29865/docs/fast-paste-text-demo.gif -------------------------------------------------------------------------------- /docs/fast-paste-text-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbentzen/sketch-fast-text-transfer/62195c49f108f6848964bc4f918c5e2512d29865/docs/fast-paste-text-icon.png -------------------------------------------------------------------------------- /docs/fast-swap-text-demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbentzen/sketch-fast-text-transfer/62195c49f108f6848964bc4f918c5e2512d29865/docs/fast-swap-text-demo.gif -------------------------------------------------------------------------------- /docs/fast-swap-text-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbentzen/sketch-fast-text-transfer/62195c49f108f6848964bc4f918c5e2512d29865/docs/fast-swap-text-icon.png -------------------------------------------------------------------------------- /docs/paypal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbentzen/sketch-fast-text-transfer/62195c49f108f6848964bc4f918c5e2512d29865/docs/paypal.png -------------------------------------------------------------------------------- /docs/runner-pro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbentzen/sketch-fast-text-transfer/62195c49f108f6848964bc4f918c5e2512d29865/docs/runner-pro.png --------------------------------------------------------------------------------