Skip to content

Instantly share code, notes, and snippets.

@mipmip
Created July 11, 2013 12:38
Show Gist options
  • Save mipmip/5975088 to your computer and use it in GitHub Desktop.
Save mipmip/5975088 to your computer and use it in GitHub Desktop.
open indesign doc
require 'rubygems'
require 'appscript'
include Appscript
pdfpath = "/Users/server/Desktop/myTempFile.pdf"
filepath = "/Users/server/Desktop/myTempFile.indd"
idApp = app('Adobe InDesign CS3')
#idApp = app('InDesignServer')
myDoc= idApp.open(filepath)
#myFrame = idApp.documents[1].pages[1].make(:new => :text_frame)
#myFrame.geometric_bounds.set(['6p', '6p', '18p', '18p'])
#myFrame.contents.set("Hello Ruby World!")
#myDoc.export( {:format => :PDF_type, :to=> MacTypes::FileURL.path(pdfpath).hfs_path})
#myDocSaved = myDoc.save(:to=> MacTypes::FileURL.path(filepath).hfs_path)
#myDocSaved.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment