GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Python Wiki
  • PSF Wiki
  • Jython Wiki
  • Python Wiki
  • Platform-Specific
  • MacPython

This view

  • Original page
  • New address

GeezerVison is showing wiki.python.org — MacPython / In Design

View as Markdown

MacPython / In Design¶

Legacy Wiki Page

This page was migrated from the old MoinMoin-based wiki. Information may be outdated or no longer applicable. For current documentation, see python.org.

Only some snippets from a simple InDesign automator…

 inD = app('Adobe InDesign CS2')
 inD.script_preferences.user_interaction_level = k.never_interact
 finder = app('Finder')
 doc = inD.open(mactypes.Alias(u'/Users/user/Documents/test.indd'))

 if doc.pages[page].side() == k.right_hand:
     print "page %d is on the righthand side" % page

How to place a text file and delete the first 2 lines:

 story = doc.place(macpath, on=doc.pages[page], showing_options=False)
 story.lines[1:2].delete()

Fix the size of the new text frame:

 rect = [76, 12, 284, 65]
 # left, top, height, width in default unit (e.g. mm)
 frame = story.text_frames[1].get()
 frame.geometric_bounds.set(rect)
 if frame.overflows():
     # too much text -> increase size
Previous
MacPython / Growl
Next
MacPython / IRC Channel
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.