Answered
This topic has been closed for replies.
Hi @Mageshwaran , I don’t think an image’s profile name is directly exposed anywhere in the API—if you try to get the image .profile property it will tell you whether InDesign is using the profile (embedded) or whether the fallback profile is being used (Use Document Default).
If it is embedded, you can get the image’s profile name from the Link Info dialog. I can’t rememer who posted this but you can extract Link Info items from the clipboard like this:
var lnks = app.documents[0].links;
var pd = "";
for (var i = 0; i < lnks.length; i++) {
lnks[i].parent.select();
var n = lnks[i].name;
pd = GetLinkInfo('ICC Profile')
$.writeln(n + ":\nICC Profile: " + pd + "\n")
//returns the image name and its ICC Profile setting
}
/**
* Gets a selection’s Link Info
* @ param the LinkInfo Item string
* Size, ICC Profile, Layer Overrides, Transparency, Dimensions, Format, Creator, Place Date, Modified, Creation Date
* @ returns the Link Info property as a string
*/
function GetLinkInfo(s){
var ds = "Not Defined"
var linfo = app.menuActions.itemByName('$ID/#LinksUICopyLinkInfoMenu');
var lp = app.menuActions.itemByName('$ID/Links')
try{linfo.invoke()}
catch(e){
lp.invoke();
if (linfo.enabled) {
linfo.invoke()
}
}
app.menuActions.itemByName('$ID/Links').invoke()
var tf = app.activeDocument.pages[0].textFrames.add()
tf.parentStory.texts[0].select()
app.paste()
var c = tf.parentStory.contents
tf.remove()
app.menuActions.itemByName('$ID/Selection Tool').invoke()
for(var i = 0; i < c.split('\r').length; i++){
if(c.split('\r')[i].split('\t')[0] == s){
ds = c.split('\r')[i].split('\t')[1]
}
}
return ds
}
Sign up
Already have an account? Login
To post, reply, or follow discussions, please sign in with your Adobe ID.
Sign inSign in to Adobe Community
To post, reply, or follow discussions, please sign in with your Adobe ID.
Sign inEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.
