Question
Step and Repeat Script help
hi everyone,
I'm a scripting virgin and was wondering if someone could help with what I imagine is a simple bit of script to add two fields in the dialogue box - no of copies horizontal and vertical:
I've got a step and repeat script, but this works the same as CS3 step and repeat from the Edit menu, where you get n copies of a placed object on an offset of x and y. What I'd like is to make n by m copies of a placed object in one go (i.e. impose a grid of objects on a defined offset to get a sheet full of copies).
Any takers? Thanx in advance if you have any eye-deers... :D
The step and repeat script I've got is as follows:
--
tell application "Adobe InDesign CS3"
if (count documents) > 0 then
set mySelection to selection
if (count mySelection) > 0 then
set myObjects to {}
repeat with myCounter from 1 to (count mySelection)
if class of item myCounter of mySelection is rectangle or ¬
class of item myCounter of mySelection is oval or ¬
class of item myCounter of mySelection is polygon or ¬
class of item myCounter of mySelection is graphic line or ¬
class of item myCounter of mySelection is text frame then
copy item myCounter of mySelection to end of myObjects
end if
end repeat
if (count myObjects) > 0 then
my myDisplayDialog(myObjects)
end if
else
display dialog "Please select an object and try again."
end if
else
display dialog "Please open a document, select an object, and try again."
end if
end tell
on myDisplayDialog(myObjects)
set myProxyList to {"TopLeft", "Top", "TopRight", "Left", "Center", "Right", "BottomLeft", "Bottom", "BottomRight"}
tell application "Adobe InDesign CS3"
set myDialog to make dialog with properties {name:"StepAndRepeat"}
tell myDialog
tell (make dialog column)
make static text with properties {static label:"Repeat Count:"}
--Spacer.
make static text
make static text with properties {static label:"Horizontal Offset:"}
make static text with properties {static label:"Vertical Offset:"}
--Spacer.
make static text
make static text with properties {static label:"Rotation:"}
make static text with properties {static label:"Skew:"}
--Spacer.
make static text
make static text with properties {static label:"Fill Tint:"}
make static text with properties {static label:"Stroke Tint:"}
end tell
tell (make dialog column)
set myRepeatField to make integer editbox with properties {edit value:2}
--Spacer.
make static text
set myXOffsetField to make measurement editbox with properties {edit value:0}
set myYOffsetField to make measurement editbox with properties {edit value:0}
--Spacer.
make static text
set myRotationField to make angle editbox with properties {edit value:0}
set mySkewField to make angle editbox with properties {edit value:0}
--Spacer.
make static text
set myFillTintField to make real editbox with properties {edit value:0}
set myStrokeTintField to make real editbox with properties {edit value:0}
end tell
tell (make dialog column)
--Spacer.
make static text
--Spacer.
make static text
make static text with properties {static label:"Stroke Weight:"}
make static text with properties {static label:"Opacity:"}
--Spacer.
make static text
make static text with properties {static label:"Horizontal Scale:"}
make static text with properties {static label:"Vertical Scale:"}
--Spacer.
make static text
--Spacer.
make static text
make static text with properties {static label:"Proxy:"}
end tell
tell (make dialog column)
--Spacer.
make static text
--Spacer.
make static text
set myStrokeWeightField to make measurement editbox with properties {edit value:0}
set myOpacityField to make real editbox with properties {edit value:0}
--Spacer.
I'm a scripting virgin and was wondering if someone could help with what I imagine is a simple bit of script to add two fields in the dialogue box - no of copies horizontal and vertical:
I've got a step and repeat script, but this works the same as CS3 step and repeat from the Edit menu, where you get n copies of a placed object on an offset of x and y. What I'd like is to make n by m copies of a placed object in one go (i.e. impose a grid of objects on a defined offset to get a sheet full of copies).
Any takers? Thanx in advance if you have any eye-deers... :D
The step and repeat script I've got is as follows:
--
tell application "Adobe InDesign CS3"
if (count documents) > 0 then
set mySelection to selection
if (count mySelection) > 0 then
set myObjects to {}
repeat with myCounter from 1 to (count mySelection)
if class of item myCounter of mySelection is rectangle or ¬
class of item myCounter of mySelection is oval or ¬
class of item myCounter of mySelection is polygon or ¬
class of item myCounter of mySelection is graphic line or ¬
class of item myCounter of mySelection is text frame then
copy item myCounter of mySelection to end of myObjects
end if
end repeat
if (count myObjects) > 0 then
my myDisplayDialog(myObjects)
end if
else
display dialog "Please select an object and try again."
end if
else
display dialog "Please open a document, select an object, and try again."
end if
end tell
on myDisplayDialog(myObjects)
set myProxyList to {"TopLeft", "Top", "TopRight", "Left", "Center", "Right", "BottomLeft", "Bottom", "BottomRight"}
tell application "Adobe InDesign CS3"
set myDialog to make dialog with properties {name:"StepAndRepeat"}
tell myDialog
tell (make dialog column)
make static text with properties {static label:"Repeat Count:"}
--Spacer.
make static text
make static text with properties {static label:"Horizontal Offset:"}
make static text with properties {static label:"Vertical Offset:"}
--Spacer.
make static text
make static text with properties {static label:"Rotation:"}
make static text with properties {static label:"Skew:"}
--Spacer.
make static text
make static text with properties {static label:"Fill Tint:"}
make static text with properties {static label:"Stroke Tint:"}
end tell
tell (make dialog column)
set myRepeatField to make integer editbox with properties {edit value:2}
--Spacer.
make static text
set myXOffsetField to make measurement editbox with properties {edit value:0}
set myYOffsetField to make measurement editbox with properties {edit value:0}
--Spacer.
make static text
set myRotationField to make angle editbox with properties {edit value:0}
set mySkewField to make angle editbox with properties {edit value:0}
--Spacer.
make static text
set myFillTintField to make real editbox with properties {edit value:0}
set myStrokeTintField to make real editbox with properties {edit value:0}
end tell
tell (make dialog column)
--Spacer.
make static text
--Spacer.
make static text
make static text with properties {static label:"Stroke Weight:"}
make static text with properties {static label:"Opacity:"}
--Spacer.
make static text
make static text with properties {static label:"Horizontal Scale:"}
make static text with properties {static label:"Vertical Scale:"}
--Spacer.
make static text
--Spacer.
make static text
make static text with properties {static label:"Proxy:"}
end tell
tell (make dialog column)
--Spacer.
make static text
--Spacer.
make static text
set myStrokeWeightField to make measurement editbox with properties {edit value:0}
set myOpacityField to make real editbox with properties {edit value:0}
--Spacer.
