Remove color failed
Hi,
I'm facing a new issue.
Version : InDesign Server CC 2021
Language : VBScript
Steps to reproducre :
- Create a new color
- Try to remove it
-> Error : Can't remove this color
Works on InDesign Server CC 2020
I can't upload my example code file so i put it here :
Set ID = CreateObject("IndesignServer.Application.2021")
Set CurDoc = ID.Documents.Add
Set NewColor1 = CurDoc.Colors.Add
NewColor1.Name = "Valid1"
NewColor1.ColorValue = Array(71, 20, 100, 10)
Set CurItem = CurDoc.Pages.Item(1).TextFrames.Add
CurItem.FillColor = NewColor1
NewColor1.Delete
CurDoc.Save "D:\Temp\Test_CC2021.indd"
CurDoc.Close
ID.Quit
Thanks
-
Marco S. commented
Seems to work in current Server 2023.
-
Olav Martin Kvern commented
Note that trying to remove the color via find/change:
app.findColorPreferences.findWhat = color_to_replace;
app.changeColorPreferences.changeTo = replacement_color;
document.changeColor();...results in a hard crash of InDesign Server. That should make this an emergency.
-
Olav Martin Kvern commented
This is a critical error in InDesign Server and should have been fixed a long time ago. Or, more exactly, the application should not have been shipped (multiple times) with this bug in place.
-
NorbertK commented
Hi all, I have more details to this bug. I did a lot of Tests. Removing colors is not possible with InDesign Server versions upper 16.2. The last version it is working is 16.0
my code is:
var myDoc = app.documents.firstItem();
for(i=myDoc.unusedSwatches.length-1;i>=0;i--)
{
myDoc.unusedSwatches[i].remove();
}In debug i get: This color cannot be deleted.
-
Cyril commented
Link to the Adobe support community subject :
https://community.adobe.com/t5/indesign-discussions/indesign-server-cc-2021-find-color/m-p/12378670