generator-exporter

[Photoshop] Automate the 'Image Assets' menu, easy to integrate into any CI pipeline.

Photoshop Assets Generator

Automate the extraction of photoshop assets using the GENERATOR PLUGIN, here you can find a detailed explanation on how you should name your layers in order for this library to work.

What this lib will do for you:

  • Automatically launch photoshop
  • Open a given array of files
  • Activate the Generator Assets Plugin
  • Close all documents after all assets has been generated, and optionally close photoshop.

Perfect for CI (Continuous Integration) This was the reason i built this anyway.

#Why do i need this?

If you are developing something that grab some assets from a psd file, why not using the the magic of assets generation to streamline your pipeline? so then you don’t have to export your assets every time you make some changes, and even better, if you are working with some kind of CI (Jenkins, Bamboo, Strider….) you can automate the assets extraction process!

#Requirements

You must have photoshop installed in your local machine in order to this lib to work.

In photoshop’s preferences go to plug-ins and make sure Enable Generator and Enable Remote Connections are checked.

Pick any Service Name you like, and input a Password (this lib defaults to 123456).

#Install

npm install generator-exporter

####Usage with Node

import { Generator } from 'generator-exporter'
import * as glob from 'glob'
import * as path from 'path'

const files = glob.sync(
    path.resolve(__dirname, '**/*.psd')
);

const generator = new Generator(files, {
    password: '123456',
    generatorOptions: {
        'base-directory': path.resolve(__dirname, 'output')
    }
})

generator.start().then(() => console.log('done'));

####Usage from Command Line

generator-cli --help 
generator-cli --files 'source/**/*.psd' --exclude '**/*(references|temp)/**' --password 654321 -c false -g.base-directory output

#Config Options

| Property | Default | Description | |—————— |———– |————————————————————————————————————————– | | closePhotoshop | true | Terminate photoshop after execution. | | hostname | 127.0.0.1 | The host the socket is listing to connections, defaults to your local IP. | | password | 123456 | The generator’s password set inside photoshop plugins section. | | port | 49494 | Socket’s port. | | maxRetries | 10 | Max number of retries this library will try to make with photoshop before assume it’s dead. | | retryDelay | 5000 | Delay between each retry. | | generatorOptions | { … } | See all the available options in here. |

Related Repositories

wordpress-to-hugo-exporter

wordpress-to-hugo-exporter

Hugo is static site generator written in golang. Wordpress is a tool for remote access to your server ;-) ❗️Contributions welcome! ...

luxor

luxor

Clojure based LXS scene graph compiler, generator & mesh exporter for Luxrender ...

generator-exporter

generator-exporter

[Photoshop] Automate the 'Image Assets' menu, easy to integrate into any CI pipeline. ...

event-tickets-generator

event-tickets-generator

Event Ticket Generator vous permet de générer des billets au format PDF, les exporter au format CSV ou importer des billets. ...