Copy link to clipboard
Copied
Hi,
I am trying to built a custom fileinfo Panel for CC applications, I referred to XMP Metadata UI SDK CC 2014 guide and built one successfully.
But I need a field where users can select multiple values from dropdown, and those will be saved into a single XMP property (e.g., <sampleSchema:cities>).
Anyone developed or solved the similar problem in CustomFileInfo panels?
Your help really appreicated.
Copy link to clipboard
Copied
I'm sorry to tell you that the dropdown can only have one selection. You will have to use a list box instead. You might not want a bunch of big list boxes filling up your UI, so you could create a pseudo drop down by setting the listbox height to 0 and using a button that expands it to a larger height revealing the list. On a button click, or some other event, the list box could go back to a height of 0 and save the selected values.
Here is a sample solution, but there are a lot of other possibilities. There is some weirdness in ScriptUI controlls like preferredSize, minimumSize, and maximumSize, so you might have to try different combinations to get the desired display in Windows or Mac.
var win = new Window('palette',"listbox as dropdown", undefined, {closeButton:true});
var keywords = ["one", "two", "three","four","five","six","seven"]
list1Grp = win.add('group');
list1Grp.orientation = 'column';
list1Grp.alignChildren = 'left';
list1Grp.spacing = 0;
list2Grp = list1Grp.add('group');
list2Grp.orientation = 'row';
list2Grp.alignChildren = 'left';
list2Grp.spacing = 0;
list1Txt = list2Grp.add('statictext',undefined,"Select Keywords");
list1Txt.preferredSize=[280,25];
list1Btn = list2Grp.add('button',undefined,":red_triangle_pointed_down:");
list1Btn.preferredSize=[20,20];
var list1 =list1Grp.add ('listbox', undefined, keywords, {multiselect: true});
list1.preferredSize=[280,0];
list2Btn = list1Grp.add('button',undefined,"Add Keywords");
list2Btn.preferredSize=[280,20];
list2Btn.visible = false;
list1Btn.onClick=function(){
list1.minimumSize=[280,150];
list1.maximumSize=[280,150];
list2Btn.visible = true;
win.layout.layout (true);
}
list2Btn.onClick=function(){
if(list1.selection == null){
list1Txt.text = "Select Keywords";
}
else{
list1Txt.text = list1.selection.join("; ") // Display the list selections. You could use this to write to XMP or put the list selections in an array to write to XMP
}
list1.minimumSize=[280,0];
list1.maximumSize=[280,0];
list2Btn.visible = false;
win.layout.layout (true);
}
win.show();
Copy link to clipboard
Copied
Thanks, but it seems like this is javascript, and user needs to run everytime if they need to add the metadata.
Is there any other way to have always running UI where users can simply click and add the multi select values?
Also, this UI what I am looking for should work some of CC applications (Bridge, Illustrator, Photoshop).
Copy link to clipboard
Copied
Why don't you read docs how to add buttons to Bridge, automatically when it's launching.
Copy link to clipboard
Copied
Yes I can if this option only for Bridge, but the question is how this option will be available/enabled on Photoshop and Illustrator (similar to XMP FileInfo panel)?
If we have this as MetadataUI then FileInfo panel will be common across all CC applications.
Copy link to clipboard
Copied
There's Startup Scripts folder in Common Files/Adobe folder to put script that you can divide into appropriate parts each for other application it has to work in, once after launched.
Copy link to clipboard
Copied
@karthikeyan.subbiah My appologies, you are working with an XML extension, but I jumped right into the JavaScript ExtendScript environment. There is more info at https://extendscript.docsforadobe.dev/index.html.
You can do a lot more with ExtendScript, but it is much more complicated because you have to code everything - the UI and all functions. Weirdly, Adobe seem to have moved the ExtendScript SDK and examples. The link http://www.adobe.com/devnet/scripting/ redirects to https://www.adobe.io/creative-cloud/ and I can't find any information about ExtendScript there. I'm having trouble navigating the new Adobe developer site, so I can't help you find what you need there.
I don't think you can accomplish what you want with an XML FileInfo extension. It could be done with ExtendScript, but the would a lot more to be added the example I provided and I'm not sure it would work in Illustrator and Photoshop. Adobe would probably like us to use the newer CEP HTML/JavaScript Extensions https://github.com/Adobe-CEP/Getting-Started-guides which I have not yet explored because it is even more complicated.
Copy link to clipboard
Copied
The docs you are looking for are on the redirected site after you log in and go to Bridge area.
Copy link to clipboard
Copied
Oh I see now, at it's in the "Download resources" link, not the "API Documentation" link.
Thanks @Kukurykus
Copy link to clipboard
Copied
@karthikeyan.subbiah This may not meet your needs exactly, but have a look at the excellent Custom Metadata Panel CEP plugin. It's much more flexible than the Info Panel and it works in Bridge, Photoshop, and Illustrator.
https://exchange.adobe.com/creativecloud.details.103752.html
https://github.com/adobe-dmeservices/custom-metadata
It has an option for a multi dropdown. It doesn't allow you to select multple items at once, but it does allow you to add items one at a time.
Copy link to clipboard
Copied
@gregreser Thanks a lot, I think it may work for my use case, let me take a look further on this, and will get back in case of any help needed.
@Kukurykus Thanks for your inputs too.
Copy link to clipboard
Copied
@karthikeyan.subbiah You might find these custom JSON configuration files useful if you are using that plugin. You can modify the JSON to use only the properties you need. This might be faster than entering properties one at a time in the panel editor. Iptc4xmpCore_properties_view.json will probably have the properties you need.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now