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

extend script is not working in photoshop but working fine in illustrator

New Here ,
Oct 13, 2022 Oct 13, 2022

Copy link to clipboard

Copied

function ImageTracingMaterial(ImageName) {
var ImagdePathCount=0;
Material_Image=ImageName;
var index;
var doc = app.activeDocument;
var DocLyrLength=doc.layers.length;
for(var i=0;i<DocLyrLength;i++){
if(doc.layers[i].name==Layer_Name) {
index=i;
break;
}
}
if(doc.layers[index].groupItems.length>0 && doc.layers[index].pageItems[0].name !="Clipped_Group"){
ExpendFunction(index,0);
}
var len=doc.layers[index].pageItems.length;
for(var i=0;i<len;i++){
ImagdePathCount++;
var pathitm=doc.layers[index].pageItems[i];
if(pathitm.name!="Clipped_Group"){
var placedItem1 = doc.layers[index].placedItems.add();
placedItem1.moveToEnd(doc.layers[index]);
placedItem1.file = new File("/Users/"+MyUsersName+"/Library/Application Support/Adobe/CEP/extensions/PSD_EdlPlugin/Material_Images/"+ImageName);
placedItem1.selected=true;
pathitm.selected=true;
app.executeMenuCommand("makeMask");
doc.layers[index].pageItems[i].name="Clipped_Group";
exportFileToJPEG();
} else{
pathitm.placedItems.removeAll();
var plcd=pathitm.placedItems.add();
plcd.moveToEnd(pathitm);
plcd.file = new File("/Users/"+MyUsersName+"/Library/Application Support/Adobe/CEP/extensions/PSD_EdlPlugin/Material_Images/"+ImageName);
exportFileToJPEG();
}
}
return ImagdePathCount;
}

TOPICS
Scripting

Views

40

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
Guide ,
Oct 13, 2022 Oct 13, 2022

Copy link to clipboard

Copied

LATEST

AI and PS have different scripting interfaces.  Their scripts are not the same.  

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