Skip to main content
Inspiring
March 23, 2021
Answered

Hide all text layers in document

  • March 23, 2021
  • 3 replies
  • 1406 views

Is it possible to hide all text layers in a multi-page document (so I can export a copy with only the pictures)?

This topic has been closed for replies.
Correct answer rob day

This would hide all of the text frames in a document:

 

var api=app.activeDocument.allPageItems;  
var i = api.length; while (i--) if (api[i].constructor.name == "TextFrame") api[i].visible = false;

 

This would show them:

var api=app.activeDocument.allPageItems;  
var i = api.length; while (i--) if (api[i].constructor.name == "TextFrame") api[i].visible = true;

3 replies

rob day
Community Expert
rob dayCommunity ExpertCorrect answer
Community Expert
March 23, 2021

This would hide all of the text frames in a document:

 

var api=app.activeDocument.allPageItems;  
var i = api.length; while (i--) if (api[i].constructor.name == "TextFrame") api[i].visible = false;

 

This would show them:

var api=app.activeDocument.allPageItems;  
var i = api.length; while (i--) if (api[i].constructor.name == "TextFrame") api[i].visible = true;
Inspiring
March 23, 2021

Thanks! I have to figure out how to use scripts (should be possible 🙂 - this will do the trick.

I have also learned that an alternative (or complement) is to put all textframes into a separate layer ("Text"). It is a way to do this as well using a script (so I can fix my files retroactively without having to go thru each single page)?

rob day
Community Expert
Community Expert
March 23, 2021

Here’s the script with a checkbox you can toggle:

 

https://shared-assets.adobe.com/link/db74af04-3e4a-4655-6f06-8071123fe832

 

When you run it you’ll get a checkbox dialog:

 

 

If you have anchored objects in the text they will get hidden with the text

rob day
Community Expert
Community Expert
March 23, 2021

If you have made a layer in the Layers panel and all of your text frames throughout the document are on that layer, hiding it would hide all of the text frames. It sounds like you want to hide any page item that is a text frame? I think you would need a script for that.

jmlevy
Community Expert
Community Expert
March 23, 2021

Yes, of course. Just untick the eye icon in the layers panel. If you want to hide all the layers except one, alt click on the one you want to keep visible.

Inspiring
March 23, 2021

Is it a way to do it at multiple pages as once (I have a 200-page document where I if possible would like to be able to toggle all text on/off with a button)?

jmlevy
Community Expert
Community Expert
March 23, 2021

Layers are not page related, so you don't have to worry about this.