Coder Social home page Coder Social logo

sketch-mail-merge's Introduction

sketch-mail-merge

Sketch plugin to merge CSV data with a template

Animation

Usage

Prepare a template and add numeric tags to your text. The first tag should start wih the number 1, for example "Hello {1}, do you '{2}'?":

Template

Prepare your data in CSV format, for example:

cat,miao
dog,woof
fox,???

Copy the CSV data so that it is in your clipboard.

Select the template and then choose the plugin Mail Merge from the menu. You should see something like:

Merged Result

Advanced usage

If you want to layout the template vertically or have more choice over the distance between the results, then you should create two templates and select both of them before using the plugin. The distance between the two templates will be applied to the new tempates.

Notes

  • if a layer's name contains tags, these too will be mail merged

Installation

Make sure you have the latest version of Sketch 3 installed.

  1. Download the ZIP file with the Plugin
  2. Double click on mail-merge.sketchplugin

Feature requests, bugs & feedback

Ping me on twitter or follow for updates.

Contributors

  • Florian Schulz (improved text input and customisable layout)

Find this useful?

If you find this plugin useful, consider buying me a cake (it goes very well with coffee!)

sketch-mail-merge's People

Contributors

kumo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sketch-mail-merge's Issues

Responsive Text

Hello i was thinking of using this plugin to also be able to replace text across responsive design so if i have 3 artboard, Desktop, Tablet, Mobile.

I would set the document as following:
{1} Title
{2} Sub Title

input the title and subtitle with this plugin and it would update all 3 views - right now the plugin just generates a new artboad and would have to this this 3 times but no way to update it once its done.

Any ideas? or maybe it should be just a whole new plugin

Handle Quotations With Commas

I recently found this plugin and LOVE it! One issue I ran into was when I exported my doc, some of my cells had commas in them. The following was the output:
Justin,"Hi, my name is Justin" instead of the normal Justin,Hi my name is Justin

It would be great if this plugin looked for the quotes and was able to recognize that the commas in that area were not related to the syntax.

Text input doesn't appear

It might be due to High Sierra or something else, but the plugin no longer shows a space for the user to type something.

Deprecation warnings

I saw in the Console app that there are some deprecation warnings, so these should be fixed.

Help required for improved input dialogue box

I would like to make a dialogue box that is similar to the following image, but I cannot get the textview to accept any input. Does anyone have any suggestions?

screenshot 2015-10-06 22 10 01

The above dialogue box was created using the following code:

var userInput = COSAlertWindow.new();

userInput.setMessageText( 'Mail Merge' );

var scrollview = [[NSScrollView alloc] initWithFrame:NSMakeRect(0,0,300,80)];
[scrollview setHasVerticalScroller:1];
[scrollview setHasHorizontalScroller:1];
[scrollview setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];

var accessory = [[NSTextView alloc] initWithFrame:NSMakeRect(0,0,300,80)]

[scrollview setDocumentView:accessory]

accessory.setString("sdsfsdf")

[userInput addAccessoryView:scrollview]

userInput.addTextLabelWithValue( 'Custom Separator' );
userInput.addTextFieldWithValue( '' );

var checkbox = NSButton.alloc().initWithFrame( NSMakeRect( 0, 0, 300, 18 ));
checkbox.setButtonType(NSSwitchButton);
checkbox.setTitle('Overwrite Template(s)');
checkbox.setTag( 'value');
checkbox.setState(false);

userInput.addAccessoryView(checkbox);

userInput.addButtonWithTitle('OK');
userInput.addButtonWithTitle('Cancel');

userInput.runModal();

Support Sketch 45 plugin update system

Hi there!

This is a quick note to remind you that Sketch 45 will include a plugin update system.

It would be awesome if you could add support to it (it's really easy!) before Sketch 45 comes out. Ideally, you should release an update for your plugin while we're still in Sketch 44, so your users will have a nice & easy experience when 45 is released.

For more details, please check http://sketchplugins.com/d/229-updating-plugins and http://developer.sketchapp.com/introduction/updating-plugins/

Thanks in advance!

Support for tab as a separator

I often have my data in a Google Spreadsheet. It would be great to copy a few columns of data and paste it into Sketch :) Right now, I can’t because its not CSV but TSV.

{#} should work on all the layers

If the surrounding group/artboard contains {#} in its name, then its name will change. The same should apply to the layers that are inside the group/artboard.

Vertical alignment with two templates fail

Posting this here to make sure it doesn't disappear in the Twitter stream. Unless I misunderstood something I expected that when I select two copies of the template that are positioned one after the other the entries from the CSV will continue to populate under my templates maintaining the relative positioning of the two. Like this:
screen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.