Skip to content

Instantly share code, notes, and snippets.

@mipmip
Created July 11, 2013 12:37
Show Gist options
  • Save mipmip/5975082 to your computer and use it in GitHub Desktop.
Save mipmip/5975082 to your computer and use it in GitHub Desktop.
appscript indesign z-index research
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")
idApp = app('Adobe InDesign CS4')
myDoc= idApp.make(:new => :document)
myFrame = idApp.documents[1].pages[1].make(:new => :rectangle)
myFrame.geometric_bounds.set(['16p', '16p', '28p', '28p'])
myFrame2 = idApp.documents[1].pages[1].make(:new => :rectangle)
myFrame2.geometric_bounds.set(['6p', '6p', '18p', '18p'])
colorstring = '10,10,10,10'
colors = colorstring.split(',')
if(colors.length == 4)
nwColor = myDoc.make(:new => :color, :with_properties => {:space => :CMYK, :color_value => [colors[0].to_i, colors[1].to_i, colors[2].to_i, colors[3].to_i]})
myFrame.fill_color.set(:to => nwColor)
end
colorstring = '40,40,0,0'
colors = colorstring.split(',')
if(colors.length == 4)
nwColor = myDoc.make(:new => :color, :with_properties => {:space => :CMYK, :color_value => [colors[0].to_i, colors[1].to_i, colors[2].to_i, colors[3].to_i]})
myFrame2.fill_color.set(:to => nwColor)
end
p myFrame.index.get
p myFrame2.index.get
myFrame.bring_to_front
#p myFrame.methods.grep(/back/)
p myFrame.index.get
p myFrame2.index.get
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment