Ditto: Use variables in Photoshop

Ditto adds something to Photoshop I’ve wanted for a long time. It allows the use of variables for things like colours, text, font sizes and perhaps most powerfully of all: visibility.

A quick GIF to show a super simple variable example.

What variables are available? Ditto currently supports variables for fill colours, strings of text, visibility, font sizes, font colours, line heights, X positions and Y positions.

Will it hinder my team’s workflow in any way? No. It does not require that the Ditto extension be installed by everyone who touches your PSD file. Those who have it can load any previously created variables, change them, delete them and add new ones—all without you having to sync any kind of separate file and all without an internet connection. Those who don’t have it installed will just see a group in the layers panel called “dittoVariables” (where Ditto stores your variables).

What are it’s requirements? Ditto requires Photoshop CC 2015 and can be used on both Mac and PC.

How much does it cost? It’s free.


Creating variables in Ditto

The Ditto panel loaded in Photoshop’s UI.

This is Ditto’s UI.

Every variable requires you to specify it’s type, it’s name and it’s value. The circular arrow on the right is the create/update button. Click it when you’ve updated a variable’s information to apply the changes to your document. The - button will delete the variable, the + one will create a new one. After opening a PSD that already has variables saved in it, click “Load Variables” to automatically import them all back into the panel ready for editing.

Using variables

In the layers panel, simply add a # then the variable’s name to every layer you want to modify with that particular variable’s value.

Take the GIF above as an example. My variable’s name is “btnText” so for every layer whose text I want to match this variable, I will add #btnText to the layer’s name.

A layer can have multiple variables and they do not dictate the naming of layers at all. A layer can, for example, be named “background #bgFill” rather than only “#bgFill”. Ditto will still find and update the variable.

Variable names can not have spaces in them and should be unique.

Variable types

We’ve already talked about what all the variables are but here’s a list of the values each one of them can take:

  • Fill: any hex value without the “#”. Example: 29adf1.
  • Text: any text, including special characters et cetera.
  • Visibility: on or off.
  • Font Size: a pixel value. Example: 20px.
  • Font Family: the postscript name of a typeface *.
  • Font Colour: the same as Fill.
  • Line Height: a pixel value. Example: 46px.
  • X & Y Positions: any value without a unit (px/pt/%). Example: 400. They’re automatically set to pixels.

Download

As I mentioned before, this extension requires Photoshop CC 2015 and will work on both Mac’s and PC’s. It’s also free—I have, however, poured many hours into it so any and all donations are very much appreciated.

Ditto doesn’t currently work in CC 2015.5.

Download



FAQ

Where can I find the postscript name of a typeface? Pick the weight you want in your font manager of choice and go to the info panel. It’ll be in the same group as “Style”, “Family” and “Full name”.

I’ve found a bug, what should I do? Please file an issue with steps to reproduce.


Release notes

21/07/2015 - Version 1.1

[FIXED] Some users reported seeing “undefined” in all
the fields when loading a group of variables in a new
file. This has been fixed.

[FIXED] Windows users couldn’t close the alert shown
when “Clear List” was clicked. The alert has been
removed.

[NEW] A “Refresh All” button was a very popular
request and has been added. This means you can
update a bunch of values at once rather than clicking
the refresh button next to each one individually.

15/07/2015 - Version 1.0

Launch!