Applescript error on Indesign command


I was writing my own script and couldn’t get it to work, so I borrowed a similar script from Jerome (member).

tell application “Adobe InDesign CS3”
set emptyframes to every text frame of layer 7 of document 1 whose contents is “”
repeat with anitem in emptyframes
set content type of anitem to graphic type
end repeat
end tell

The compiler hangs up on line 6. It says it expected end of line, but found to.

I can set a different text frame property (as in “set fill tint to 20”), and I can get the content type of the text frame. But I can’t set the content type. Is this a broken feature of InDesign? Or do I need to address the text frame’s parent (I tried page items already.)


Hi Paeon

Does changing this line

set content type of anitem to graphic type

to this

set (content type) of anItem to graphic type

make any difference?

Yes! It works! Thank you.

Thanks Budgie, I have been trying out for days and couldn’t figure out the syntax. Thanks again!

wow this is an oldy :lol:

my pleasure

Yea, I’m interested in seeing the original thread to see what I wrote. I can’t imagine posting something like this unless I tested it to see if it worked. I wonder if it was originally done for CS2 or an older version of AppleScript that didn’t need the parens to compile?

Found it, originally set up for CS2 and was done in 2007. ( )