Skip to main content
Inspiring
November 28, 2012
Question

Conversion of Multi Ad Creator files to InDesign files

  • November 28, 2012
  • 1 reply
  • 1177 views

I am working on what has turned out to be a rather ambitious project.

I have managed to get nearly everything working with the exception of text and layering order.

Looking for help with text here.

From Creator I originally copied the text from each frame, created an identical sized fram in InDesign and pasted the text. It kept the formating sort of... It wasn't very good though.

Since speed isn't my goal but accurate conversion I thought to iterate through every character of every text frame.

Character Properties of the two programs

----indd {auto leading:120.0, drop cap characters:0, dropcap detail:1, drop cap lines:0, drop cap style:character style id 116 of document id 37 of application "Adobe InDesign CS5.5", fill tint:-1.0, fill color:color id 11 of document id 37 of application "Adobe InDesign CS5.5", font:font "Myriad Pro          Bold" of application "Adobe InDesign CS5.5", left indent:0.0, right indent:0.0, stroke tint:-1.0, stroke color:swatch id 14 of document id 37 of application "Adobe InDesign CS5.5", stroke weight:1.0, desired letter spacing:0.0, maximum letter spacing:0.0, minimum letter spacing:0.0, miter limit:4.0,  justification:left, single word justification:full, horizontal scale:100.0, skew:0.0, font style:"Bold", size:12.0, vertical scale:100.0, space after:0.0, space before:0.0, leading:auto, track:0.0, underline color:"Text Color", underline gap color:swatch id 14 of document id 37 of application "Adobe InDesign CS5.5", underline gap tint:-1.0, underline overprint:false, underline offset:-9999.0, underline type:stroke style id 23081 of document id 37 of application "Adobe InDesign CS5.5", underline tint:-1.0, underline weight:-9999.0, underline:false, underline gap overprint:false, desired word spacing:100.0, maximum word spacing:133.0, minimum word spacing:80.0}

----creator {offset:0, font:"Helvetica Regular", size:4.0, text color:{color:"Black", shade:100.0}, text fill color:{color:"Black", shade:99.996948242188}, text shadow color:{color:"Black", shade:100.0}, style:{off styles:{bold, italic, underline, outline, word underline, shadow, condensed, expanded, superscript, subscript, superior, inferior, all caps, all lowercase, title case, small caps}, on styles:{}}, effects:{bold outset:5.0, italic skew:13.999209828974, outline weight:5.0, shadow settings:{horizontal offset:7.0, vertical offset:7.0, skew angle:0.0, vertical scale:100.0, outset:0.0}}, fixed leading:0.0, automatic leading:100.0, horizontal scale:100.0, vertical offset:0.0, tracking:0, type style name:"None", language:"US English", first indent:{new:0.0}, left indent:{new:0.0}, right indent:{new:0.0}, drop cap:false, space before:0.0, space after:0.0, tabs:{tab list:{}}, alignment:flush left, hyphenation:false, quad leader:"", paragraph style name:"None"}

I can match things up and do the conversion:

Say I set the properties of the character from creator to the variable mycharprops

  set myleading to ((size of mycharprops) * ((automatic leading of mycharprops) * 0.01)) + (fixed leading of mycharprops)

 

This will get me the proper leading to use for InDesign... repeat for everything.

The Problem


set myTextFrame to make text frame

set contents of insertion point -1 of myTextFrame to mychar

set properties of last character of myTextFrame to {leading:myleading}

Adobe InDesign CS5.5 got an error: Can’t set properties of last character of text frame id 246 of spread id 198 of document id 83 to {leading:6}.

The Question:

So is there a better way to insert a character into the a text frame and apply properties to it?

This topic has been closed for replies.

1 reply

Inspiring
November 28, 2012

Hi,

guess it's overset as the textframe is to small.

Try to set some bounds first

set myTextFrame to make text frame with properties {geometric bounds:{0, 0, 100, 100}}

so it hopefully can contain one character ;-)

lithodoraAuthor
Inspiring
November 29, 2012

No, I left that part off for simplicity.

--as part of a repeat from a tell creator block...

  set myprops to properties of text flow z of document 1

  set thisrect to item 1 of text container list of myprops

  set thisrectprops to properties of thisrect

  set thebounds to bounds of thisrectprops as list

  set thisrotation to rotation of thisrectprops

  set topb to (item 1 of thebounds as number) / 72

  set leftb to (item 2 of thebounds as number) / 72

  set bottomb to (item 3 of thebounds as number) / 72

  set rightb to (item 4 of thebounds as number) / 72

  set convertedbounds to {topb, leftb, bottomb, rightb}

 

  tell application "Adobe InDesign CS5.5"

   set myDocument to document 1

   set myPage to page 1 of myDocument

   tell myPage

    set myTextFrame to make text frame

    set geometric bounds of myTextFrame to convertedbounds

    set absolute rotation angle of myTextFrame to (thisrotation * -1)

   end tell

  end tell