Import images to artboards?

New Here ,
Jun 14, 2016

Copy link to clipboard

Copied

Hello!

I'm trying to figure out a way to import images into their own artboards.

I know there's a script for importing into stacked layers but I don't really know Javascript enough to modify that to import into artboards instead.

Does anyone know of a script that does this? or of some scripts that do something similar that I could hack together to do what I want?

The second step would be to also name the artboards the same name as the image that got put into that artboard.

Thanks for any help/direction you can give me.

TOPICS
Actions and scripting

Views

3.4K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Import images to artboards?

New Here ,
Jun 14, 2016

Copy link to clipboard

Copied

Hello!

I'm trying to figure out a way to import images into their own artboards.

I know there's a script for importing into stacked layers but I don't really know Javascript enough to modify that to import into artboards instead.

Does anyone know of a script that does this? or of some scripts that do something similar that I could hack together to do what I want?

The second step would be to also name the artboards the same name as the image that got put into that artboard.

Thanks for any help/direction you can give me.

TOPICS
Actions and scripting

Views

3.4K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jun 14, 2016 1
LEGEND ,
Jun 17, 2016

Copy link to clipboard

Copied

Could you give screenshots of an example (including Layers Panel)?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 17, 2016 0
Community Beginner ,
Jun 18, 2016

Copy link to clipboard

Copied

This would be very desired feature for color grading between multiple images. Working with windows is cumbersome and distracting. The thick borders and shadows ruin how the photo is perceived on a print or in a layout where it is presented without any boarders against white background.

Artboards could serve as a "light table" where you could not only adjust colors in the context of other images, but also place them freely in a specific order for a story/editorial and see them as a whole.

I think this is much desired feature for photograpers and alikes.

Screen Shot 2016-06-18 at 20.09.46.jpeg

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 18, 2016 0
Community Beginner ,
Jun 18, 2016

Copy link to clipboard

Copied

I found this, but it seems to be broken..

LINK:

experimental-ps-scripts/filesToArtboards.jsx at master · nvkzNemo/experimental-ps-scripts · GitHub

// filesToArtboards.jsx - Adobe Photoshop Script
// Version: 0.5.0
// Requirements: Adobe Photoshop CC 2015, or higher
// Author: Anton Lyubushkin (nvkz.nemo@gmail.com)
// Website: http://lyubushkin.pro/
// ============================================================================
// Installation:
// 1. Place script in:
// PC: C:\Program Files\Adobe\Adobe Photoshop CC#\Presets\Scripts\
// Mac: <hard drive>/Applications/Adobe Photoshop CC#/Presets/Scripts/
// 2. Restart Photoshop
// 3. Choose File > Scripts > filesToArtboards
// ============================================================================
#target photoshop
app.bringToFront();
function cTID(s) {return app.charIDToTypeID(s);}
function sTID(s) {return app.stringIDToTypeID(s);}
function newArtboard(_name, _w, _h) {
   var desc6 = new ActionDescriptor();
   var ref1 = new ActionReference();
  ref1.putClass(sTID('artboardSection'));
  desc6.putReference(cTID('null'), ref1);
   var desc7 = new ActionDescriptor();
  desc7.putString(cTID('Nm  '), _name);
  desc6.putObject(cTID('Usng'), sTID('artboardSection'), desc7);
   var desc8 = new ActionDescriptor();
  desc8.putDouble(cTID('Top '), 0);
  desc8.putDouble(cTID('Left'), 0);
  desc8.putDouble(cTID('Btom'), _h);
  desc8.putDouble(cTID('Rght'), _w);
  desc6.putObject(sTID('artboardRect'), sTID('classFloatRect'), desc8);
   executeAction(cTID('Mk  '), desc6, DialogModes.NO);
}
function main() {
   var fileList = app.openDialog("Select your files"),
   delta = 0,
   currentDocWidth = 0;
  if (fileList != null && fileList != "") {
   var doc = app.documents.add(400, 400, 72, "File1");
   for (var i = 0; i < fileList.length; i++) {
  app.open(fileList[i]);
  currentDocWidth = app.activeDocument.width.value + 20;
  app.runMenuItem(sTID('selectAllLayers'));
   newArtboard(app.activeDocument.name, app.activeDocument.width.value, app.activeDocument.height.value);
  app.activeDocument.activeLayer.duplicate(doc, ElementPlacement.INSIDE);
  app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
  if (i > 0) {
  app.activeDocument.activeLayer.translate(delta, 0);
  }
  delta = delta + currentDocWidth;
  }
  doc.crop([0, 0, app.activeDocument.width + delta, app.activeDocument.height]);
  app.runMenuItem(charIDToTypeID("FtOn"));
   alert('Done!');
  }
}
main();

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 18, 2016 0
LEGEND ,
Jun 19, 2016

Copy link to clipboard

Copied

The Script seems to work here, what is the problem on your set-up?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 19, 2016 0
Community Beginner ,
Jun 19, 2016

Copy link to clipboard

Copied

After I select the files to load, the script seems to get stuck at the line 40:

app.runMenuItem(sTID('selectAllLayers'));

I get a prommpt of the following contents:

The command "Select" is not currently available.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 19, 2016 0
LEGEND ,
Jun 19, 2016

Copy link to clipboard

Copied

Ah, I had used files with multiple layers and this problem arises with flat images …

You could wrap that line in an if- or a try-clause.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 19, 2016 1
Community Beginner ,
Jun 19, 2016

Copy link to clipboard

Copied

Tight. I tried to remove this line all together, but the script doesn't to  the job regardless.

On my layered files it makes a complete mess on the canvas, spreading tiny artboards far apart with incomplete contents.

In any case, I believe it's a 5-10min task for an Adobe engeneer and a utility of such a script with "Save Artboard to files" counter-part would be invaluable.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 19, 2016 0
LEGEND ,
Jun 19, 2016

Copy link to clipboard

Copied

I believe it's a 5-10min task for an Adobe engeneer

The whole things seems to be a problematic concept to start with because the selected images might be of different CoLor Modes, Color Spaces, bit depth …

On my layered files it makes a complete mess on the canvas, spreading tiny artboards far apart with incomplete contents.

Then you may have to start with defining what exactly you want to happen instead.

What if the images are of different sizes, resolutions, have content extending beyond the canvas, …

As for the incomplete duplication: Which objects exactly are missing?

For me Artboards have been a pretty much useless feature because I work for print mainly.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 19, 2016 0
Community Beginner ,
Jun 19, 2016

Copy link to clipboard

Copied

Like I stated many times on different occasions - artboards have a huge utility for the print.

I work with photos and most of the time I need to adjust their colors in relationship to other photos in the set. Say, a photographer shoots an editorial and he needs to have consistent colors between various shots and present them in a full page series in a book. With artboards, you can have a bird's eye view on the layout, see the photos in relationship to eachother, without the distraction from window boarders and shadows. Plus, it's much easier to move between the adjustment layers if everything is in a single layers panel and you can keep full screen with a custom background color.

What I liked for the script do to, is to prepare the artboards from the files as they are and place them gaplessly in 1 row and 3 columns for 3 files and row by row in 2 columns for more than 3. The consistent color space and bit-depth can be a prerequisit.

Just like you can "Load Files as Layers" I would like to have "Load Files to Artboards" option from Bridge.

That would vastly improve Photoshop's workflow and streamline my process, and hopefuly the process of thousands other people. The finesse of Photoshop adjustments is unparalled to any other software.

In summary. Artboards are necessary for a more convenient, unobtrusive and streamlined color grading of photos that are going to be presented in a magazine/book/layout next to each other.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 19, 2016 0
LEGEND ,
Jun 20, 2016

Copy link to clipboard

Copied

Like I stated many times on different occasions - artboards have a huge utility for the print.

Fortunately we do not need to agree as in Photoshop there often are several ways to achieve the same or a similar result …

The consistent color space and bit-depth can be a prerequisit.

A prerequisite?

The Script would have to include checks for all those properties nonetheless, I guess.

place them gaplessly in 1 row and 3 columns for 3 files and row by row in 2 columns for more than 3

That would only work out for identically dimensioned images, wouldn’t it?

So more properties to check for … 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 20, 2016 0
New Here ,
Jun 20, 2016

Copy link to clipboard

Copied

Here's a screenshot example of what the end result should look like. (sans the logos)

Screen Shot 2016-06-20 at 8.35.40 AM.png

I tried that script you found but it stops at line 43 for me. It prompts me saying the command select is not available. I click ok and gives me, Error user canceled the operation:

Line: 43

->    app.runMenuItem(sTID('selectAllLayers'));

I'll "play" with the code when I can to see if i can get it to work.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 20, 2016 0
New Here ,
Jun 13, 2018

Copy link to clipboard

Copied

Here is the working script, simply removed the line 41.

// Version: 0.5.0

// Requirements: Adobe Photoshop CC 2015, or higher

// Author: Anton Lyubushkin (nvkz.nemo@gmail.com)

// Website: http://lyubushkin.pro/

// ============================================================================

// Installation:

// 1. Place script in:

// PC: C:\Program Files\Adobe\Adobe Photoshop CC#\Presets\Scripts\

// Mac: <hard drive>/Applications/Adobe Photoshop CC#/Presets/Scripts/

// 2. Restart Photoshop

// 3. Choose File > Scripts > filesToArtboards

// ============================================================================

#target photoshop

app.bringToFront();

function cTID(s) {return app.charIDToTypeID(s);}

function sTID(s) {return app.stringIDToTypeID(s);}

function newArtboard(_name, _w, _h) {

   var desc6 = new ActionDescriptor();

   var ref1 = new ActionReference();

  ref1.putClass(sTID('artboardSection'));

  desc6.putReference(cTID('null'), ref1);

   var desc7 = new ActionDescriptor();

  desc7.putString(cTID('Nm  '), _name);

  desc6.putObject(cTID('Usng'), sTID('artboardSection'), desc7);

   var desc8 = new ActionDescriptor();

  desc8.putDouble(cTID('Top '), 0);

  desc8.putDouble(cTID('Left'), 0);

  desc8.putDouble(cTID('Btom'), _h);

  desc8.putDouble(cTID('Rght'), _w);

  desc6.putObject(sTID('artboardRect'), sTID('classFloatRect'), desc8);

   executeAction(cTID('Mk  '), desc6, DialogModes.NO);

}

function main() {

   var fileList = app.openDialog("Select your files"),

   delta = 0,

   currentDocWidth = 0;

  if (fileList != null && fileList != "") {

   var doc = app.documents.add(400, 400, 72, "File1");

   for (var i = 0; i < fileList.length; i++) {

  app.open(fileList);

  currentDocWidth = app.activeDocument.width.value + 20;

   newArtboard(app.activeDocument.name, app.activeDocument.width.value, app.activeDocument.height.value);

  app.activeDocument.activeLayer.duplicate(doc, ElementPlacement.INSIDE);

  app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);

  if (i > 0) {

  app.activeDocument.activeLayer.translate(delta, 0);

  }

  delta = delta + currentDocWidth;

  }

  doc.crop([0, 0, app.activeDocument.width + delta, app.activeDocument.height]);

  app.runMenuItem(charIDToTypeID("FtOn"));

   alert('Done!');

  }

}

main();

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 13, 2018 2
New Here ,
Nov 24, 2020

Copy link to clipboard

Copied

hey! should i just copy and paste this? dont really know much about this.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 24, 2020 0
GFE_MMXV LATEST
New Here ,
Nov 24, 2020

Copy link to clipboard

Copied

same. dont know how to do it 😞

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 24, 2020 0