tell application "Adobe InDesign CS6"
--activate
--- Setting Measurement units to Point and Origin
set theOrigin to ruler origin of view preferences of document 1
if theOrigin is not spread origin then
set ruler origin of view preferences of document 1 to spread origin
end if
set myOldViewPreferences to properties of view preferences of active document
set horizontal measurement units of view preferences of active document to points
set vertical measurement units of view preferences of active document to points
set myTextInfoLayerName to "•Image Info"
set mydocument to active document
tell mydocument
set InfoStyle to make paragraph style with properties {name:"Image Info", applied font:"Times", font style:"Plain", fill color:swatch "Black", point size:6, justification:left align, leading:7}
try
set myLayer to layer myTextInfoLayerName of mydocument
on error
-- Create the layer if it didn't already exist.
tell mydocument
set myLayer to make layer
set name of myLayer to myTextInfoLayerName
end tell
end try
set IDLinks to links whose status is normal
repeat with myCounter from 1 to (count IDLinks)
set myLink to link myCounter of mydocument
if link type of myLink is "Photoshop" or link type of myLink is "JPEG" or link type of myLink is "TIFF" then
set theImage to parent of item myCounter of IDLinks
set myFilePath to file path of item myCounter of IDLinks
set LinkName to name of item myCounter of IDLinks
set theFrame to parent of theImage
set EffectRes to effective ppi of theImage
set HRes to item 1 of EffectRes as string
set VRes to item 2 of EffectRes as string
set ColorSpace to space of theImage
set myRotation to rotation angle of theImage
set myHScale to horizontal scale of theImage
set myVScale to vertical scale of theImage
set myShear to shear angle of theImage
set {a, b, c, d} to geometric bounds of theFrame
repeat
set theClass to class of parent of theFrame
if theClass = master spread then
set theSpread to parent of theFrame
exit repeat
end if
if theClass = spread then
set theSpread to parent of theFrame
exit repeat
end if
if theClass = page then
set theSpread to parent of theFrame
exit repeat
end if
end repeat
set myH to 35
set myW to 100
set mytrueLabelPositon to {(a + c) / 2 - (myH / 2), (b + d) / 2 - (myW / 2), (a + c) / 2 + (myH / 2), (b + d) / 2 + (myW / 2)}
set ImgTxtFrame to make text frame at theSpread with properties {fill color:swatch "Paper", layer:myLayer}
set geometric bounds of ImgTxtFrame to mytrueLabelPositon
set vertical justification of text frame preferences of ImgTxtFrame to center align
set inset spacing of text frame preferences of ImgTxtFrame to {2, 2, 2, 2}
set ignore wrap of text frame preferences of ImgTxtFrame to true
set applied paragraph style of insertion point 1 of ImgTxtFrame to InfoStyle
set contents of insertion point 1 of ImgTxtFrame to "Path: " & LinkName & return & "W Scale: " & (round (myHScale * 10)) / 10 & return & "H Scale: " & (round (myVScale * 10)) / 10 & return & "Rotation: " & myRotation
end if
end repeat
end tell
tell view preferences of active document to set properties to myOldViewPreferences
if theOrigin is not spread origin then
set ruler origin of view preferences of document 1 to theOrigin
end if
end tell