Copy link to clipboard
Copied
"Error: Invalid value for set property 'fillColor'. Expected Swatch, String or NothingEnum enumerator, but received in indesign"
Hi,
as far as I can see from your code, this line:
app.findObjectPreferences.fillColor = _DO_NOT_PRINT_Swatches1[s];
tries to assign the name of a color to the fillColor property.
Instead try the following by assigning the color itself and not its name:
app.findObjectPreferences.fillColor =
myDoc.colors.itemByName( _DO_NOT_PRINT_Swatches1[s] );
I hope, that your myDoc variable refers to the active document.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
"Error: Invalid value for set property 'fillColor'. Expected Swatch, String or NothingEnum enumerator, but received in indesign"
Hi,
as far as I can see from your code, this line:
app.findObjectPreferences.fillColor = _DO_NOT_PRINT_Swatches1[s];
tries to assign the name of a color to the fillColor property.
Instead try the following by assigning the color itself and not its name:
app.findObjectPreferences.fillColor =
myDoc.colors.itemByName( _DO_NOT_PRINT_Swatches1[s] );
I hope, that your myDoc variable refers to the active document.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Ir seems you are finding some specific swatch, saving its name and the using it to find some objects. I think the error is on line
Copy link to clipboard
Copied
Yes. it valid value. here index is swatches name.
Copy link to clipboard
Copied
Hi,
as far as I can see from your code, this line:
app.findObjectPreferences.fillColor = _DO_NOT_PRINT_Swatches1[s];
tries to assign the name of a color to the fillColor property.
Instead try the following by assigning the color itself and not its name:
app.findObjectPreferences.fillColor =
myDoc.colors.itemByName( _DO_NOT_PRINT_Swatches1[s] );
I hope, that your myDoc variable refers to the active document.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
I tried this too, but still facing error, but instead of am found one thing,
Once try to manual, then the automation working well, but once app quit its shown same.
Copy link to clipboard
Copied
The error may be from the line below the .fillColor line:
varresultObject = myDoc.findObject();
You need a space after 'var' at the start.