Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Applying Alpha channel as softmask when placing Image in Indesign

Community Beginner ,
Feb 09, 2021 Feb 09, 2021

Copy link to clipboard

Copied

Hi guys!

 

I am trying to write a simple extend script which activates alpha mask of an imported image in InDesign.

As far as I know the only way to do it is to activate it in the place image options so I am re-placing the file again. I take the name of the alpha mask I need, but I cannot find how to activate it.

I read in the documentation about javascripting the folowing:

    place (fileName:File, [showingOptions:Boolean=Boolean], withProperties:Object) , but I cannot find the construction of the Object for the withProperties value.

I guess that this withProperties object is ImageIOPreferences object so I managed to create  a script with which I display the values of the object ImageIOPreferences of an already imported image, but it only displays the values, and not the names of the properties.

 

 

var Doc = app.activeDocument
var DocPics = app.selection
if (DocPics.length>0) {
    for (i=0;i<DocPics.length;i++)  {
        if (DocPics[i].constructor.name=="Image") {
            var Pic = DocPics[i]
            var PicBox = Pic.parent
            }
        else {
            var PicBox = DocPics[i]
            var Pic = PicBox.images[0]
            }
    }

for (x in Pic.imageIOPreferences) {
    txt += Pic.imageIOPreferences[x] + " ; ";
  };
  alert(txt)
}

 

 

Does anybody know how I can find the construction of the withProperties object so I can activate the alpha mask while placing the image?

 

Greetings and thanks in advance,

Denis.

TOPICS
How to, Performance, Scripting

Views

99

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

correct answers 1 Correct answer

Adobe Community Professional , Feb 09, 2021 Feb 09, 2021

Likes

Translate

Translate
Adobe Community Professional ,
Feb 09, 2021 Feb 09, 2021

Copy link to clipboard

Copied

LATEST

Hi,

 

Is this not what you are looking for - https://community.adobe.com/t5/indesign/set-placed-image-alpha-channel/td-p/4983226

 

Malcolm

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