• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Changing opacity of text

Guest
Nov 25, 2013 Nov 25, 2013

Copy link to clipboard

Copied

I'm trying to change/access the opacity of a text object (Illustrator CC).

In the documents, I found that it's represented by a text frame object, but it doesn't have opacity property. Text range and character attributes don't have it either, so I'm wondering: is there any way of accessing/altering the opacity of a text object using Javascript?

TOPICS
Scripting

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Engaged ,
Nov 25, 2013 Nov 25, 2013

Copy link to clipboard

Copied

This works in VB.NET if this is of any help...

Dim aDoc As AI.Document = app.ActiveDocument

  For Each pi In aDoc.PageItems

   Select Case TypeName(pi)

    Case "TextFrame"

     Dim tf As AI.TextFrame = pi

     tf.Opacity = 20  '20% Opacity

   End Select

  Next

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 26, 2013 Nov 26, 2013

Copy link to clipboard

Copied

it is not documented but text frames do have opacity property in Javascript, as stated above in vb as well.

yourTextFrame.opacity = 50; // 50% opacity

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Dec 05, 2013 Dec 05, 2013

Copy link to clipboard

Copied

Hi Carlos, as inquired in this recent thread:

http://forums.adobe.com/thread/1350419?tstart=0

Does illustrator have the ability to change opacity at the per character level like in the UI via scripting?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 05, 2013 Dec 05, 2013

Copy link to clipboard

Copied

I couldn't do it directly, the workaround is

- create a new character style manually with the opacity needed

- apply such character style to any textRange via scripting

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Dec 05, 2013 Dec 05, 2013

Copy link to clipboard

Copied

LATEST

CarlosCanto wrote:

I couldn't do it directly, the workaround is

- create a new character style manually with the opacity needed

- apply such character style to any textRange via scripting

Hi CarlosCanto, ok thanks for the heads up, I was unable to target it directly in my attempts either. Thanks for the workaround idea, that becomes a bit cumbersome if you have a large number of values desired however. It always amazes me how many of the UI features are inaccessible via scripting (sigh). Thanks again for responding.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines