Skip to main content
Participating Frequently
May 29, 2012
Answered

Test for type of frame

  • May 29, 2012
  • 2 replies
  • 1075 views

First, a little background: I've been AppleScripting QuarkXPress for about 12 years and some tasks, such as displaying a page in a document, seemed much easier to script in QuarkXPress, so please forgive my "newbie" questions and status with InDesign. We just switched our production department to InDesign, from QuarkXPress, and now I have the task of rewriting all of the old QuarkXPress scripts.

Here's the (current) issue: I want to add a little error checking to my AppleScript to determine if a frame is a text frame. Unfortunately, I cannot figure out any way to execute that test.

Any and all help, as well as possible resources for scripting InDesign, would be greatly appreciated.

This topic has been closed for replies.
Correct answer -hans-

hi,

i guess you're looking for :

content type (unassigned/‌graphic type/‌text type) : The type of content that a frame can contain.

2 replies

TᴀW
Legend
May 29, 2012

Well, the simplest way would be:

if (myFrame instanceof TextFrame) etc.

Ariel

Visit www.id-extras.com for powerful InDesign scripts that save hours of work — automation, batch tools, and workflow boosters for serious designers.
Participating Frequently
May 30, 2012

Hi Ariel ... This one looks more like JavaScript. When I'm done rewriting my AppleScripts, the geek in me wants to rewrite them again in JavaScript so I have a handle on how to write them too! Thanks.

-hans-Correct answer
Inspiring
May 29, 2012

hi,

i guess you're looking for :

content type (unassigned/‌graphic type/‌text type) : The type of content that a frame can contain.
Jongware
Community Expert
Community Expert
May 29, 2012

Additionally, you might have to deal with the philosophical question "If a text frame contains no text at all, is it still a text frame?"

TᴀW
Legend
May 29, 2012

"Additionally, you might have to deal with the philosophical question

"If a text frame contains no text at all, is it still a text frame?""

And if you're going to deal with that, you'll have to watch out for the

very sticky issue of how to know whether an otherwise empty textframe

contains the continuation of a footnote or a table -- i.e., instances

where the parent insertion point is in the previous text frame.

I still haven't cracked that one!

Ariel

Visit www.id-extras.com for powerful InDesign scripts that save hours of work — automation, batch tools, and workflow boosters for serious designers.