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

difficult to equalize the position of the image

Community Beginner ,
Aug 31, 2016 Aug 31, 2016

Hello!!

It will make a script difficult to ask for help.

1. Select and copy all the images in the document AAA.ai.

2. Paste the BBB.ai document.

3. However, the image of AAA and BBB are located must be the same.

It is difficult to equalize the position of the image.

Please help me.

var inputFolderPath = null;

var totalFilesConverted = 0;

var inputFolderPath = new Folder(Folder.selectDialog('AAA folder select.'));

var inputFolderPath2 = new Folder(Folder.selectDialog('BBB folder select.'));

var testFiles = inputFolderPath.getFiles("*.ai");

var testFiles2 = inputFolderPath2.getFiles("*.ai");

try{

for (d = 0; d < testFiles.length;d++)

      {

var docRef =  app.open(testFiles);

var doc = docRef.activeLayer;

var docName = docRef.name;

var newGroup = doc.groupItems.add();

for (var i = doc.pageItems.length-1; i >= 0; i--) {

var p = doc.pageItems;

if(p.guides != true&&p.typename != "TextFrame")

{

p.selected =true;

}   

}

var selectedObject = docRef.selection;

app.copy();

var docRef2 = app.open(new File(inputFolderPath2 + "/" + docName));

var doc2 = docRef2.activeLayer;

for (var i = doc2.pageItems.length-1; i >= 0; i--) {

var p2 = doc2.pageItems;

if(p2.guides != true&&p2.typename != "TextFrame")

{

p2.selected =true;

}   

}

if ( docRef2.selection.length > 0 ) {

for (var i = selection.length-1; i >= 0; i--) {

    selection.remove();

}

}

app.paste();

docRef2.save();

}

}

catch(e) {

  alert(e);} 

   

alert('OK');

TOPICS
Scripting
363
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
Adobe
Engaged ,
Sep 01, 2016 Sep 01, 2016

eun young junge46173962, hi!

If I understand the question, instead

app.paste ();

can be used

executeMenuCommand ('pasteFront');

or

executeMenuCommand ('pasteInPlace');

Compatible CS6+

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
Community Beginner ,
Sep 06, 2016 Sep 06, 2016
LATEST

Thank you for your answers.
But I'm using CS5.

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