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

Remove elements from PS file

Engaged ,
Jan 25, 2018 Jan 25, 2018

Copy link to clipboard

Copied

I have a simple script that I run from within an Action that flattens layers, deletes paths + channels + layer comps from files.

app.activeDocument.flatten();

app.activeDocument.channels.removeAll();

app.activeDocument.pathItems.removeAll();

app.activeDocument.layerComps.removeAll();

It works fine within PS.

If I run the Action through Bridge under Tools/Batch on files, the resulting process always throws up a dialog asking if I want to remove the paths from the files.

Why is this happening only when I run the Action through Bridge?

Thanks.

TOPICS
Actions and scripting

Views

984

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

correct answers 1 Correct answer

LEGEND , Jan 25, 2018 Jan 25, 2018

displayDialogs = DialogModes.NO; with(activeDocument) {

     flatten(), arr = ['layerComps', 'pathItems', 'channels']

     while(itm = arr.pop()) eval(itm + '.removeAll()')

}

Votes

Translate

Translate
Adobe
LEGEND ,
Jan 25, 2018 Jan 25, 2018

Copy link to clipboard

Copied

displayDialogs = DialogModes.NO; with(activeDocument) {

     flatten(), arr = ['layerComps', 'pathItems', 'channels']

     while(itm = arr.pop()) eval(itm + '.removeAll()')

}

Votes

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
Engaged ,
Jan 25, 2018 Jan 25, 2018

Copy link to clipboard

Copied

Sorry, I didn't see your post before I posted my solution. Thanks.

Votes

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
LEGEND ,
Jan 25, 2018 Jan 25, 2018

Copy link to clipboard

Copied

Time to mark it as solved to let others know it's solved btw did you solve that problem:

Removing number sequence in 'Export layers to files" in CS5​ / you may post your script...

Votes

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
Engaged ,
Jan 25, 2018 Jan 25, 2018

Copy link to clipboard

Copied

I think I solved the issue by using a different script posted here in the forum.

#target photoshop

var theImage = app.activeDocument;

// supress dialog windows

displayDialogs = DialogModes.NO

// flatten image

theImage.flatten();

// delete paths

theImage.pathItems.removeAll();

// delete alphas

theImage.channels.removeAll();

// delete layercomps

theImage.layerComps.removeAll();

This seems to work fine from within Bridge.

Votes

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 ,
Apr 23, 2020 Apr 23, 2020

Copy link to clipboard

Copied

LATEST

Just stumbled over this old post, a related topic can be found here:

 

https://community.adobe.com/t5/photoshop/free-script-remove-selected/m-p/11069360

 

Votes

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