Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8143667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:10:50+00:00 2026-06-06T13:10:50+00:00

Here is my attempt: function makeAllTextBlack() { var document = app.activeDocument, textFrames = document.textFrames,

  • 0

Here is my attempt:

function makeAllTextBlack() {
  var document = app.activeDocument,
    textFrames = document.textFrames,
    nbTextFrames = textFrames.length,
    swatch = document.swatches.item("C=100 M=100 Y=100 K=100"),
    i;
  for (i = 0; i < nbTextFrames; i +=1) {
      textFrames[i].fillColor = swatch;
  }
}

makeAllTextBlack();

When running this script in the ExtendScript Toolkit, it complains that the value defined for the fillColor property is incorrect, saying that it expected a Swatch or a String but received nothing. Is there something wrong with my swatch?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T13:10:52+00:00Added an answer on June 6, 2026 at 1:10 pm

    The swatch you get that way is invalid, even if you try to get it by name (itemByName) don’t ask me why, but it is better to use Color objects. For example you could do this to create the color:

    var color = document.colors.itemByName("myblack");
    if(color==null){
        color = document.colors.add();
        color.name = "myblack";
        color.colorValue = [100,100,100,100];
    }
    

    Then apply it directly to the fillColor property.

    (one remark, textFrames.fillColor will not change the texts color, but the TextFrame background… I think you want to iterate the texts on each TextFrame and change their fillColor.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my attempt at the jQuery: $(document).ready(function(){ $('#bg').animate({ backgroundPosition: '320px 0px'}, 10000, 'linear'); });
I'd like to sort by time,day. Here is my attempt: var days = new
Here is my attempt at implementing a C++ event. class Event{ typedef std::tr1::function<void( int&
Here is my attempt in jquery that kind of works but something is going
How to dynamically change the timeout of the cycle plugin here is my attempt
I'm trying to calculate time blocks from given date range. Here's my attempt: <?php
Here is my first attempt at validating XML with XSD. The XML file to
Here in stackoverflow, if you started to make changes then you attempt to navigate
Total noob here. This is my first c# attempt, its a console application that
Rookie C++ Programmer here again I'm using VC++ VS2008 and making an attempt at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.