• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Conversion of Multi Ad Creator files to InDesign files

Participant ,
Nov 27, 2012 Nov 27, 2012

Copy link to clipboard

Copied

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?

TOPICS
Scripting

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Nov 27, 2012 Nov 27, 2012

Copy link to clipboard

Copied

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 😉

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

LATEST

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


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines