I inherited the above but have little experience with scripts, I'm not sure why im getting the above error.
I did try changing the scripts location from Favorites to Indesign but that ran the same error.
Any help would be greatly appreciated!
Do you have a document open? and has it been saved at least once?
I do and yes it has been saved.
I updated the pages and now it won't run.
myArray is missing "CW" and "TL" at their respective places.
You iterate through the for-loop 12 times, adding +12 in line 24 - that results in 24 entries you need to have in myArray – you only have 22.
That's one part which could be improved by using masterSpread.baseName which doesn't contain the spread prefix. So I would cut the array short at "L-TL" and then change line 24 to
myMaster.baseName instead of myArray[i+12]
In the top left dropdown showing Extendscript Toolkit, select InDesign and then try