Code Monkey home page Code Monkey logo

Comments (4)

joonaspaakko avatar joonaspaakko commented on June 3, 2024 1

So I put on my thinking cap... and realized that it almost already had the capability to do that if you just added a folder paths to the output.filename. The only issue was that the output.filename wasn't taken into consideration when making new directories, so PS wouldn't have known where to put the files. It needed a very small change and now it does!

So now starting from v.1.7 you can do something like this:

var output = {
  path: './_output files',
  format: 'jpg',
  filename: '@input/@mockup - @input', 
};

P.S. v.1.7 updated in the main repository and the standalone example

P.P.S. Having folder paths in output.filename does feel a bit weird, but it was easier to do that than to put the filename keywords into output.path.

from batch-mockup-smart-object-replacement-photoshop-script.

joonaspaakko avatar joonaspaakko commented on June 3, 2024

I think you need to draw me like a diagram or something, for me to fully get it.

from batch-mockup-smart-object-replacement-photoshop-script.

RDslva avatar RDslva commented on June 3, 2024

Let me see if this helps...

Starting Folder Structure:

_output
input

file 1.jpg
file2.jpg
file3.jpg

templates

template1.psd
template2.psd
template3.psd

Currently, if I set 'output.folders' to true, my output folder would look like

_output

template1

template 1 file 1.jpg
template 1 file 2.jpg
etc...

template2

template 2 file 1.jpg
etc...

My desired output would be the following

_output

file 1

template 1 file 1.jpg
template 2 file 1.jpg
template 3 file 1.jpg

file 2

template 1 file 2.jpg
template 2 file 2.jpg
etc...

Screenshot 2023-04-02 at 11 08 57 AM
Screenshot 2023-04-02 at 11 09 53 AM
Screenshot 2023-04-02 at 11 09 38 AM

Essentially, instead of grouping the output folder based on the 'mockup' or 'template' used, group by the input file used.

from batch-mockup-smart-object-replacement-photoshop-script.

RDslva avatar RDslva commented on June 3, 2024

Outstanding! I hadn't thought of using the filename functionality to handle creating folders, as the output.folder property existed. I'll pull the new code and give it ago. Thanks for the update! 👍🏻

from batch-mockup-smart-object-replacement-photoshop-script.

Related Issues (6)

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.