Is this what you are looking for?
Thank you Fred
No this imports the Tags only...
what I am looking for is this:
My script needs to "call this menu, press the Load... button, choose a file, import from that file"
It would be some simple thing like loading the colour swatches from another file...
but would say something like app.activeDocument."loadTagsStylesMap"(myStyleFile);
I don't see any direct way to import, but you can open the document and then loop through the xmlImportMaps
myImportMaps = activeDocument.xmlImportMaps;
for(var x = 0;myImportMaps.length>x;x++)
var myStyle = myImportMaps[x].mappedStyle;
Took the words out of my mouth...
Actually, it needs to be a bit different.
1) You need to read the Document.xmlImportMaps from the source doc.
2) You'll need to step through that and find the corresponding style (by name) in the target doc.
3) add Document.xmlImportMaps to the target doc.
Looping through my current document and matching all the tags to the "myStyleFile", then picking up the correct style from the "myStyleFile.
I get it!
Now befor I start coding...
The manual way of doing this in ID is so simple.
And I have beed down this kind of rabbit hole before, coding routine after routine, and then somebody comes up with an undocumented function that does it all in one line.
Are we "pritty sure" that pressing the 2 buttons in manuall mode can not be done via script in one line?
Thank you very much for your help!
Unless doc.mapXMLTagsToStyles() will help, I don't think you're going to find a function...
I am turning my process upside down.
I actually open "myStyleFile" and use this as the base file.
It contains all the styles, colours and what not.
I delete all its content and import the new content.xml file into this empty file.
And I deleted about half the code in my import script as I don't need to import the styles and colours from an other file.
Thanks for your help thougth