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

Batch processing with this script

New Here ,
Feb 22, 2023 Feb 22, 2023

I find this script and need to do the batch processing and save the files to a new folder. Please anybody help me. Thanks a lot

function main() {
  var doc = app.activeDocument;
  var layerName = "Cut";
  try {
    var _layer = doc.layers[layerName];
  } catch (e) {
    alert("No layer exists with name " + layerName);
  }
  app.executeMenuCommand("deselectall");
  var _pageItems = doc.pageItems;
  for (var i = 0; i < _pageItems.length; i++) {
    if (
      _pageItems[i].stroked &&
      _pageItems[i].strokeColor.red == 255 &&
      _pageItems[i].strokeColor.blue == 0 &&
      _pageItems[i].strokeColor.green == 0
    ) {
      _pageItems.selected = true;
      break;
    }
  }
  app.executeMenuCommand("Find Stroke Color menu item");
  var _allItems = app.selection;
  for (var i = 0; i < _allItems.length; i++) {
    _allItems[i].move(_layer, ElementPlacement.PLACEATEND);
  }
}

main();

 

TOPICS
Scripting
230
Translate
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
no replies

Have something to add?

Join the conversation
Adobe