Question

This seems like it should be very simple, but of course it's blowing up on me.

I'm working with Adobe InDesign CS3 on a form and when certain conditions are met I have a text frame that I've labelled in the script label panel as "RUSH" (no quotes in label panel). that I want to make nonprinting. So far it looks like this:

document.textFrames.item("RUSH").nonprinting = false;

and yet whenever I execute that script I get the error 45 "object not valid"

I'm new to inDesign scripting and I've been searching all day for an example or answer but so far nothing. Any thoughts? Did I do or miss something super dumb?

UPDATE: to summarize the below answer, what I was missing was .itemByName

The code now functions as intended with the following line:

document.textFrames.itemByName("RUSH").nonprinting = false;

With the frame tagged in the Scripts Label panel.

Thanks to everyone for your help!

Was it helpful?

Solution

So in this thread on the Adobe forum, a poster says: "Use the Script Label panel in CS4 and below, but the Layers panel in CS5 and above."

On CS6, I can get the text frame to be nonprinting by naming it "RUSH" in the Layers Panel, and running this code:

var rush = doc.textFrames.itemByName("RUSH");
rush.nonprinting = false;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top