mipmip
7/11/2013 - 12:33 PM

get indesign image info

get indesign image info

require 'rubygems'
require 'appscript' 
include Appscript

outputDir= File.join(ENV['HOME'],'Desktop')
pdfpath = File.join(outputDir, "myTempFile.pdf")
filepath = File.join(outputDir, "myTempFile.indd")
imagepath = File.join(outputDir, "Schermafbeelding.png")
imagepath = File.join(outputDir, "Schermafbeelding.png")
imagepath = File.join(outputDir, "test.pdf")

idApp = app('Adobe InDesign CS4')
myDoc= idApp.make(:new => :document)
myFrame = idApp.documents[1].pages[1].make(:new => :rectangle)
myFrame.geometric_bounds.set(['6p', '6p', '18p', '18p'])

myFrame.frame_fitting_option.fitting_alignment.set(:to => :bottom_center_anchor)
myFrame.place(MacTypes::FileURL.path(imagepath).hfs_path) 

p myFrame.graphics.class_.get
p myFrame.graphics.item_link.file_path.get
#p myFrame.graphics