• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

Free script: Remove Selected

Contributor ,
Oct 12, 2018 Oct 12, 2018

Copy link to clipboard

Copied

Hi all,

I wanted to share a super simple script that creates a checkbox for removing Channels, Paths, Colour Pickers and/or LayerComps allowing a simple interface in case you don't always wish to remove all.

Can someone test on Windows for me

#target photoshop  

//Created by Dale R, for public and commercial use

//global variables

var w = new Window('dialog', 'Batch Remove');

w.preferredSize = [50,100];

w.alignChildren = "left"; // align checkboxes to left

// creating buttons and checkboxes

var ck1 = w.add("CheckBox { text: 'Paths', value: false}");

var ck2 = w.add("CheckBox { text: 'Channels', value: false}");

var ck3 = w.add("CheckBox { text: 'Layer Comps', value: false}");

var ck4 = w.add("CheckBox { text: 'Colour Samplers', value: false}");

var p = w.add ('panel', undefined)

p.alignment = "center";

var btn = p.add('button', undefined, 'Run')

p.add ("button", undefined, "Cancel")

btn.onClick =  function () {

    w.close();

    if (ck1.value == true) {

    app.activeDocument.pathItems.removeAll();   

        }

    if (ck2.value == true) {

        app.activeDocument.channels.removeAll();

        }

    if (ck3.value == true) {

        app.activeDocument.layerComps.removeAll();

        }

    if (ck4.value == true) {

        app.activeDocument.colorSamplers.removeAll();

        }

}

w.center();

w.show();

TOPICS
Actions and scripting

Views

6.5K

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
community guidelines
Community Beginner ,
Sep 17, 2022 Sep 17, 2022

Copy link to clipboard

Copied

It works!!! how amazing... if you didn't get it already im quite excited for this!!

Again i'll have to ask many questions, what is a spot channel? i'm not following..

___

And here comes a puzzle that i would like opinions on how to make the most efficient! 🙂

Normally i work with around 300 pictures for ecom. When i'm done retouching them all i would like the following to happen:

- Flatten image

- Delete all Alpha

- Delete all Paths

- Finally saving the image in a specific pixel ratio, this depends on the costumer so it would have to be editable if put into an action.

- the images saved as a tiff and jepg in different folders

 

Soooo.. does anyone have any surgestions?

 

Kindest sunny fall regards from denmark!!!

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
community guidelines
Community Expert ,
Sep 17, 2022 Sep 17, 2022

Copy link to clipboard

Copied

Spot channels are for separate non-CMYK printing plates using custom named colours or Pantone or HKS systems etc.

 

Yes, it is possible to do what you are asking, however, specific info is required...

 

For example, where are the 300 images? Surely not all open at once? 

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
community guidelines
Community Beginner ,
Sep 17, 2022 Sep 17, 2022

Copy link to clipboard

Copied

Okay, i'm following now..

 

Great!!

No, i keep them in a project folder on my desktop, in an sub-folder called 10_DRAFT. I use the same folderstructure with the same nameing each time, but create new ones from project to project.

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
community guidelines
Community Expert ,
Sep 17, 2022 Sep 17, 2022

Copy link to clipboard

Copied

What do you need for the saved files 'pixel aspect ratio' and how does this relate to the aspect ratio of the source files.

 

What are the file format options for each format?

 

Are the saves overwriting the originals? I'm not clear on the input vs output folder structure.

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
community guidelines
Community Beginner ,
Sep 17, 2022 Sep 17, 2022

Copy link to clipboard

Copied

I'm not fully understanding the first question.. but ill try my best to anwser!

Depending on the costumer they ask for the pictures delivered in different pixel dimensions.. the most commen is 1920x2880, but some times its different.. so if it is possible to plug in the pixel dimension from task to task that would be the most favourable..

 

I work on the photos in PSD file and would like to convert it to the following two:

-1920 × 2880_TIFF_Full_Resolution_Adobe_RGB_(1998)_8bit

-1920 × 2880_JPEG_Quality_75_Full_Resolution_sRGB IEC61966-2.1_1

 

Not overwriting the origionals but creating a "copy" in a new folder.

 

Does this help?.. please write me if i need to explain further og give more information..

 

Thank you!!

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
community guidelines
Community Expert ,
Sep 17, 2022 Sep 17, 2022

Copy link to clipboard

Copied

@Pandos 

 

One solution is to record the following script into an action:

 

var origDoc = activeDocument;
origDoc.duplicate(origDoc.name.replace(/\.[^\.]+$/, ''), true);
activeDocument.flatten();
activeDocument.channels.removeAll();
activeDocument.pathItems.removeAll();
origDoc.close(SaveOptions.DONOTSAVECHANGES);

 

The action can be run when using the Image Processor Pro script:

 

https://sourceforge.net/projects/ps-scripts/files/Image%20Processor%20Pro/v3_2%20betas/ImageProcesso...

 

The IPP script can fit the image proportionally to a given pixel dimension on the longest edge. It can run the action. It can save up to 10 different combinations of different files and settings in single run. It can save presets which can be called up and adjusted on the fly for the next project. It can make you a cup of coffee or tea.

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
community guidelines
Community Beginner ,
Sep 17, 2022 Sep 17, 2022

Copy link to clipboard

Copied

thank you so much!!

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
community guidelines
Community Expert ,
Sep 19, 2022 Sep 19, 2022

Copy link to clipboard

Copied


@Pandos wrote:

I'm not fully understanding the first question.. but ill try my best to anwser!

Depending on the costumer they ask for the pictures delivered in different pixel dimensions.. the most commen is 1920x2880, but some times its different.. so if it is possible to plug in the pixel dimension from task to task that would be the most favourable..

 

You mentioned aspect ratio, ideally, the output aspect ratio is the same as the original, otherwise cropping or distorting would be required.

 

Is the output the same as the original 1920x2880px? Or does this mean that the PSD may be a different size than the required output of 1920x2880px? If a different size, would it need proportional scaling or distortion?

 


I work on the photos in PSD file and would like to convert it to the following two:

-1920 × 2880_TIFF_Full_Resolution_Adobe_RGB_(1998)_8bit

-1920 × 2880_JPEG_Quality_75_Full_Resolution_sRGB IEC61966-2.1_1


 

So, if the original PSD was titled ProjectABC123.psd, then the copies would be called:

 

ProjectABC123-1920×2880_TIFF_Full_Resolution_Adobe_RGB_1998_8bit.tif

ProjectABC123-1920×2880_JPEG_Quality_75_Full_Resolution_sRGB.jpg

 

And you are saving into a project folder on the desktop, however, the project folder name changes from project to project (so this would be set as a variable in the script).

 

The sub-folder structure is always the same though, the files would be saved into the "12_FINAL" folder into two new or existing folders named "TIF" and "JPG".

 

Is that correct?

 

The Image Processor Pro script should allow you to create the workflow that you want, however, time permitting I'll look into a custom script once all of the details are crystal clear.

 

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
community guidelines
Community Beginner ,
Sep 26, 2022 Sep 26, 2022

Copy link to clipboard

Copied

I use Capture one for the raw development of the files, and crop the image in the same program - the aspect ratio depends on the projekt.. i always export the files in psd 8 bit. The cropped aspect ratio will be the same as the intented finish crop..

___

So, if the original PSD was titled ProjectABC123.psd, then the copies would be called:

 

ProjectABC123-1920×2880_TIFF_Full_Resolution_Adobe_RGB_1998_8bit.tif

ProjectABC123-1920×2880_JPEG_Quality_75_Full_Resolution_sRGB.jpg

 

And you are saving into a project folder on the desktop, however, the project folder name changes from project to project (so this would be set as a variable in the script).

 

The sub-folder structure is always the same though, the files would be saved into the "12_FINAL" folder into two new or existing folders named "TIF" and "JPG".

 

Is that correct?

 

YES, ths is correct 🙂

__

i've gotten the imageprocessor to work, tho the crop is causing me some dificulties.. thank you for all the help.

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
community guidelines
Community Expert ,
Sep 26, 2022 Sep 26, 2022

Copy link to clipboard

Copied

i've gotten the imageprocessor to work, tho the crop is causing me some dificulties.. thank you for all the help.


By @Pandos

 

The Image Processor Pro script can proportionally resize the longest edge to a target dimension and PPI value. It doesn't crop, cropping would be done beforehand or via an action run by the script.

 

More meaningful info is required to help with your issues.

 

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
community guidelines
Community Beginner ,
Sep 17, 2022 Sep 17, 2022

Copy link to clipboard

Copied

Screenshot 2022-09-17 at 15.48.23.png

 This is my usual folderstructure.. where i work on the images in draft and would like the finished files to end up in their folders separete in 12_FINAL..

 

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
community guidelines