Developing small mockup plugins for Sketch

In the Internet design process we use a lot of good software, these software does not provide all the functions, so most of them provide modules to write automation scripts, so that designers will develop their own according to the needs of their daily work. It's not a job grab with programmers, most of the programming by designers is an extension of applications built after programmers have made complex tools, to get more customized features by assembling the existing features provided by the tools, this use of machines to solve repetitive work is the embodiment of the spirit of the Internet. This article is going to share the process of writing plugins for Sketch based on the daily work requirements of the design team of the Internet Finance Department.

I. Introduction to the plug-in.

Since Sketch doesn't have the smart object functionality of Photoshop, trying to do a mockup of a mobile app (mockup means to put a page over a physical image of a phone to simulate how the app would look on a phone) requires a commercial plugin like Magic Mirror that offers many sophisticated features. However in most cases a complex mockup scene (containing various perspective angles, selected pages) only needs to be created at the end of the project. More applications are to stage the full page presentation to those involved in the project during the design process. Throughout the course of the project, there will be multiple changes to the design, and to manually go through and create mockup pages each time would undoubtedly be a time-consuming and repetitive effort. Our design team wrote a simple mockup plugin based on such a practical need: etrobot/SimpleMockup-for-Sketch, which can create mockup images in bulk with one click.


1.(a) Name the mockup page, starting with "#Mockup".

2.The target layer of the mockup page to be named starting with "#".

3.The "screen" inside the mockup page must be a rectangle, named the same as the source panel.

4.(a) The drawing boards inside the source page must not be renamed.

5.(a) Select the source page to run the plug-in, which will then automatically search for a rectangle with the same name as the drawing board in the page to fill.

The demo is included within the etrobot/SimpleMockup-for-Sketch project, run it as shown to see the display.

II. Plugin development process.

Sketch, like most good design software, offers modules for extended programming. And all extension scripts are unencrypted, which means that anyone can see the source code of the extension scripts. As designers, we obviously can't compare our programming skills with professional programmers, and the only way to get to our goal as fast as possible is to read plugins that have similar functionality to what we need, and extract some of the code to modify them, instead of getting stuck in an endless quagmire of learning programming.

The first step in this process, as a designer, is to break down your requirements, which in this example are.

1. Generate an image that merges all visible layers of the current artboard (equivalent to clicking on the flatten option of the menu).

2. Locate the image generated by filling the screen rectangle of the mockup.

Once the requirements are broken down, look for similar plugins. We found, which is a plug-in that can merge specified layers within the drawing board and fill to other target layers within the document, which contains the code we need to merge and fill as needed.

Reading the code, extracting the code, running it in Sketch's Run Script window, making changes based on error reporting prompts, as well as using search engines and asking development colleagues for advice, the functional plugin was completed in two to three business days.

III. Summary.

Through the writing of this plugin, we developed the skills to use elementary code knowledge to solve certain design tasks that have a repetitive labor nature. A small plugin that a designer spends two or three working days delivering saves the entire design team far more than two working days, and more time will be spent thinking about the design, working creatively. With the arrival of the era of artificial intelligence, more simple repetitive labor such as simple typesetting will gradually be replaced by machines. Designers who do not want to be replaced by machines must know how to use machines to complete repetitive labor and focus more on problem-solving ideas and creativity in order to have a broader space in the future.

1、Monitor the database for user login and logout session information
2、Chief scientist Shi Jianbo helps Harness Technology continue to lead the way in autonomous driving
3、CompuSmart is online
4、Replacing server memory
5、Blockchain CLP HEC Third Kindergarten Several big projects are signed and started Future Science and Technology City is going to be on fire again

    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送