Hallo Mike,
und hier ist eine erste Lösung. Schon recht komfortabel, kannst Du im Script das Ausrechnen der
Abstände steuern, indem Du die als 'property' definierte Variable 'boxDistance' auf "enger", "mittel"
oder "weiter" setzest.
Was bedeuten diese drei Ausdrücke?
Mit "enger" wird die Anzahl der zu setzenden Kästchen auf die nächsthöhere Ganzzahl aufgerundet.
Egal, ob 5.12 oder 5.92: Beide werden zu 6.
Mit "mittel" werden Dezimalstellen von 0.5 und höher aufgerundet. Darunter wird abgerundet.
Mit "weiter" wird die Anzahl der zu setzenden Kästchen auf die nächstkleinere Ganzzahl abgerundet.
Die genannten 5.12 und 5.92 werden beide zu 5.
Je nach Dimension des Layouts wird zwischen "mittel" und "weiter" kein Unterschied zu sehen sein.
Aber mit dem von Dir genannten Format von 300 x 125 mm (und einem gewünschten Abstand von
50 mm) schon.
Die Properties 'boxH' und 'boxW' dienen zum Bestimmen der Boxenhöhe und -breite. Mit 'boxC'
definiert man die Distanz vom Seitenrand zur Boxenmitte und mit 'fillColor' die Hintergrundfarbe.
Code property boxDistance : "enger" --property boxDistance : "mittel" --property boxDistance : "weiter" property boxH : 0.5 property boxW : 0.5 property boxC : 2 property fillColor : "Schwarz" global decSep set decSep to "" try "1.5" as real set decSep to "." on error set decSep to "," end try tell document 1 of application "QuarkXPress 6.1" set tmpVal to text returned of (display dialog "Abstand der Kästchen (in mm):" default answer "") set stepVal to "" repeat with i from 1 to count of tmpVal set curChar to character i of tmpVal if curChar is in "0123456789" then set stepVal to stepVal & curChar else if curChar is in ",." then set stepVal to stepVal & decSep else display dialog "Die Eingabe für den Abstand ist ungültig. Du hast getippt: " & tmpVal buttons "OK" default button 1 with icon 0 error number -128 end if end repeat if not (color spec fillColor exists) then set fillColor to name of color spec 1 whose locked = true and RGB color value = {0, 0, 0} end if set pageWidth to page width as millimeter units as real set pageHeight to page height as millimeter units as real set xMargin to boxC - (boxW / 2) set yMargin to boxC - (boxH / 2) set ty1 to yMargin set by1 to pageHeight - yMargin - boxH set x1 to xMargin set lastX1 to pageWidth - xMargin - boxW set lastY1 to by1 set totX to lastX1 - x1 set totY to lastY1 - ty1 set tmpXVal to (totX / stepVal) set tmpYVal to (totY / stepVal) if boxDistance is "enger" then if not ((tmpXVal as string) ends with ".0") then set nBoxesH to (tmpXVal + 1) div 1 else set nBoxesH to tmpXVal div 1 end if if not ((tmpYVal as string) ends with ".0") then set nBoxesV to (tmpYVal + 1) div 1 else set nBoxesV to tmpYVal div 1 end if else if boxDistance is "mittel" then set nBoxesH to (tmpXVal + 0.5) div 1 set nBoxesV to (tmpYVal + 0.5) div 1 else if boxDistance is "weiter" then set nBoxesH to tmpXVal div 1 set nBoxesV to tmpYVal div 1 else display dialog "Die Einstellung \"" & boxDistance & "\" ist nicht vorgesehen." buttons ¬ "OK" default button 1 with icon 0 error number - 128 end if set defXstep to totX / nBoxesH set defYstep to totY / nBoxesV tell page 1 try delete (every graphic box whose name is "blackBox") end try repeat with i from 1 to nBoxesH + 1 make graphic box at beginning with properties ¬ {bounds:{"" & ty1 & "mm", "" & x1 & "mm", "" & (ty1 + boxH) & "mm", "" & (x1 + boxW) & "mm"} ¬ , color:fillColor, shade:100, name:"blackBox"} make graphic box at beginning with properties ¬ {bounds:{"" & by1 & "mm", "" & x1 & "mm", "" & (by1 + boxH) & "mm", "" & (x1 + boxW) & "mm"} ¬ , color:fillColor, shade:100, name:"blackBox"} set x1 to x1 + defXstep end repeat set x1 to xMargin repeat with i from 2 to nBoxesV set ty1 to ty1 + defYstep make graphic box at beginning with properties ¬ {bounds:{"" & ty1 & "mm", "" & x1 & "mm", "" & (ty1 + boxH) & "mm", "" & (x1 + boxW) & "mm"} ¬ , color:fillColor, shade:100, name:"blackBox"} make graphic box at beginning with properties ¬ {bounds:{"" & ty1 & "mm", "" & lastX1 & "mm", "" & (ty1 + boxH) & "mm", "" & (lastX1 + boxW) & "mm"} ¬ , color:fillColor, shade:100, name:"blackBox"} end repeat end tell end tell Das Script "Kaestchen_6x_01d" ist unterwegs zu Dir.
Gruss, Hans