Hi,
I have a simple script to create a box with image name, however it always shows in the corner of an image, is there a way to make it so it will show in the middle (center) of the image, and adjust text box to size of image name? Please let me know if anyone knows, it will be so helpful and time saving for me Thank you… here is a script I have so far:
tell application “InDesign CS”
tell document 1
tell view preferences
set horizontal measurement units to points
set vertical measurement units to points
end tell
set myColor to swatch “Paper”
try
set labelStyle to character style “Black”
on error
set labelStyle to make character style with properties {name:“Black”, applied font:“Helvetica”, font style:“Medium Condensed”, point size:13, fill color:“Black”} – change font or font style to suit your needs.
end try
–myLinksName is the name of the layer containing the links tags.
set myLinksName to “Links Names”
try
–Get the layer on which to place the links tags.
set myLayer to layer myLinksName
on error
–Create the layer if it didn’t already exist.
set myLayer to make layer at beginning with properties {name:myLinksName}
end try
repeat with i from 1 to count of links
set imageClass to class of parent of link i
if imageClass is in {PDF, image, EPS} then
set picFrame to parent of parent of link i
set theBounds to geometric bounds of picFrame
set theBounds to {item 1 of theBounds, item 2 of theBounds, (item 1 of theBounds) + 15, (item 2 of theBounds) + 75}
repeat
set theClass to class of picFrame
if theClass is in {page, spread} then
set theTarget to picFrame
exit repeat
else if theClass is in {character, text, insertion point} then –
inline
set picFrame to parent text frame of character 1 of picFrame
else
set picFrame to parent of picFrame
end if
end repeat
set labelFrame to make text frame at theTarget with properties {geometric bounds:theBounds, label:“Pic label”, contents:{name of link i} as text, fill color:myColor, item layer:myLayer, text wrap preferences:«constant tilpnone»}
set properties of text frame preferences of labelFrame to {inset spacing:{“0p1”, “0p1”, “0p2.5”, “0p1”}, vertical justification:«constant cnalcent», ignore wrap:true}
end if
end repeat
end tell
beep
with timeout of 30 seconds
display dialog "Finished." buttons {"OK"} default button 1
end timeout
end tell