Skip to main content
Inspiring
February 4, 2014
Answered

Convert to Grayscale

  • February 4, 2014
  • 2 replies
  • 5612 views

Hello,

It is possible to apply the Convert to Grayscale(Edit->Edit Colors->Convert to Grayscale) for the selected items in illustrator cs3 in script (javascript)?

Kindly advice me the possiblities.

I'm a begginer I hope somebody help me

Thanks a lot

Florin

This topic has been closed for replies.
Correct answer CarlosCanto

Hello Carlos,thanks again but I have this error : "Invalid enumeration

value" and I saw that imageColorSpace is read-only too.

Now this alert(app.activeDocument.rasterItems.imageColorSpace) return

ImageColorSpace.CMYK

2014-02-04 CarlosCanto <forums_noreply@adobe.com>:

Re: Convert to Grayscale created by CarlosCanto<http://forums.adobe.com/people/CarlosCanto>in *Illustrator

Scripting* - View the full discussion<http://forums.adobe.com/message/6085018#6085018


oops, sorry about that, I should have checked before giving you bad advice.

you may have to record an action (manually) to convert to grayscale then run the action via javascript

or

use executeMenuCommand, and try to find the right "string" to call convert to grayscale

both methods are new to CS6, but undocumented. Search the forum, usage samples have been posted before...sorry I'm still with CS5 I can't test.

check here

http://forums.adobe.com/message/4568818#4568818

2 replies

Inspiring
February 4, 2014

to be more exactly I have to convert an image from color to Grayscale :

After I place the image in the illustrator,

1. Select the image

2. Now Select Edit > Edit Colors > Convert to Grayscale

It's possible in a script?

CarlosCanto
Community Expert
Community Expert
February 4, 2014

yes, it is possible, same steps as when we do it manually

- placedItems.add()

- placedItem.embed()

- colorizedGrayscale = true;

CarlosCanto
Community Expert
CarlosCantoCommunity ExpertCorrect answer
Community Expert
February 5, 2014

Hello Carlos,thanks again but I have this error : "Invalid enumeration

value" and I saw that imageColorSpace is read-only too.

Now this alert(app.activeDocument.rasterItems.imageColorSpace) return

ImageColorSpace.CMYK

2014-02-04 CarlosCanto <forums_noreply@adobe.com>:

Re: Convert to Grayscale created by CarlosCanto<http://forums.adobe.com/people/CarlosCanto>in *Illustrator

Scripting* - View the full discussion<http://forums.adobe.com/message/6085018#6085018


oops, sorry about that, I should have checked before giving you bad advice.

you may have to record an action (manually) to convert to grayscale then run the action via javascript

or

use executeMenuCommand, and try to find the right "string" to call convert to grayscale

both methods are new to CS6, but undocumented. Search the forum, usage samples have been posted before...sorry I'm still with CS5 I can't test.

check here

http://forums.adobe.com/message/4568818#4568818

Inspiring
February 4, 2014

in illustrator cs6 ,sorry