Tired of telling people how to install your awesome Sketch template? Unfortunatly, Sketch does not provide a “Save as Template” option and navigating to the buried folder can be tedious.
Let’s create a drag-and-drop installer to make it easy for others to add your template to their
New From Template menu.
When you are done, your custom template will appear in the
New From Template menu:
1. Download DMG Canvas
It is possible to create an installer using Disk Utility, but it’s very tedious and requires several steps. The simplest tool I’ve found to make a DMG installer is DMG Canvas. It provides all of the tools necessary to add background, files and automates the DMG creaton process. It’s free to use and only costs $15 to register. I am not affiliated with DMG Canvas.
2. Add a background Image
If you purchased the DMG Installer, you can use the built-in background and text options. If you didn’t purchase the software, you can still add a background image. We’ll be creating it in Sketch, so it’s not an issue if you didn’t buy the software.
Create the background in Sketch
The default dimension DMG Canvas provides is
600x360 for the finder window. In Sketch, create an art board with the same dimensions:
600x360. If you change the dimensions in DMG Canvas, change them accordingly in Sketch.
On the Sketch art board, add a background, title and arrow. It should look something like below. I added two boxes to highlight the files. Get creative and make it your own.
Export the canvas as JPG, we’ll need it in the next step.
Add the background to DMG Canvas
In DMG Canvas, add the background image by clicking
Background > Add Image.
3. Add the file and folder shortcut
Add theSketch file
Ensure you are on the
Contents section of DMG Canvas, otherwise you can’t add files.
Add the Sketch file that you want to use a template by dragging and dropping into DMG Canvas, or by clicking
Contents > Add Files.
Tip: The file name will be the name in the
New From Templatemenu.
Add the shortcut to the templates folder
New From Template menu looks for files in a specific folder. We’ll need to add a shortcut to this folder.
Open Finder, select
Go > Go to Folder, paste the following and click OK:
Finder should take to the Sketch folder where the
Templates folder can be found.
To make a shortcut, drag the
Templates folder from Finder to DMG Canvas while holding down Option. A shortcut arrow should appear on bottom left corner the folder. Otherwise a copy of the folder will be made, rather than a shorcut.
It should now look something like below. Make the icons larger with the
Icon size slider in the right panel.
4. Build the DMG
Build icon from the icon menu and give the file a meaningful filename and volume name, like
Tip: Create a custom icon for the DMG file, see Apple’s instructions.
5. Try it out
You now how a custom DMG installer. When the DMG is opened, it mounts a read-only drive and allows the the user to drag and drop the Sketch file into Sketch’s template folder.
You should now see your template in Sketch’s
File > New From Template menu.
Congratulations! You now have a way to easily package your awesome template into a installer that allows anyone to add your template to the
New From Template. This is even more powerful when you create a template using your team’s shared symbol library.