Copy link to clipboard
Copied
I got the error:
Map does not have a constructor on this simple line:
copyMap = new Map();
Isnt map included since 10 years or so? id i do something wrong or do I really have to implement is myself?
Adobe's ExtendScript is based on ECMAScript 3, from 1999.
Copy link to clipboard
Copied
Hi @Lordrhavin , there’s no map object or maps collection. There are collections\objects like ObjectStyleExportTagMaps, StyleExportTagMaps, XMLExportMap, etc. Maybe some context would help, or you can search the API here:
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Application.html
Copy link to clipboard
Copied
Adobe's ExtendScript is based on ECMAScript 3, from 1999.
Copy link to clipboard
Copied
I'm not sure how I managed to delete my mention of polyfills before hitting "Post." But no, I've found that we typically don't have to actually reimplement this kind of stuff ourselves. Someone else has most likely already done so - usually some years ago, in the name of maintaining backwards compatibility for older web browsers. Every single time I've thoughtlessly used something like map or indexOf, I've been able to find a perfectly functional polyfill in a few clicks.
Copy link to clipboard
Copied
But no, I've found that we typically don't have to actually reimplement this kind of stuff ourselves.
https://community.adobe.com/t5/indesign-discussions/copying-page-content/td-p/14882538
Copy link to clipboard
Copied
You could also try UXP scripting. It's a bit more modern (uses Javascript 6) but still isn't quite at API parity with the old ExtendScript which most scripts are still written in.