Hallo Hans,
[u]Ist-Zustand: [/u]
Ich habe einen Textrahmen und einen Grafikrahmen. Als Referenz nutze ich den Textrahmen.
[u]Soll-Zustand:[/u]
Text- und Grafikrahmen sollen
a) am Mittelpunkt ausgerichtet werden (Grafikrahmen schiebt sich über den Textrahmen)
b) an der oberen Kande ausgerichtet werden (Beide stehen auf der gleichen Höhe)
c) der Grafikrahmen soll 5,5 mm über den Textrahmen hinausgucken.
Inzwischen bin ich fündig geworden und habe das folgende Script getestet.
Es läuft alles nach meinen Vorstellungen und am Ende ist der [u]Soll-Zustand der Ist-Zustand[/u] :D
Danke für die Hilfe, pjoern
tell application "Adobe InDesign CS2"
[nbsp] activate
[nbsp] if exists active document then
[nbsp] [nbsp] [nbsp] tell active document
[nbsp] [nbsp] [nbsp] [nbsp] if (count of (get selection)) = 2 then
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] set theTextFrame to item 1 of every item of selection whose class is text frame
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] set theOtherObject to item 1 of every item of selection whose class is not text frame
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] set {ty1, tx1, ty2, tx2} to geometric bounds of theTextFrame
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] set {oy1, ox1, oy2, ox2} to geometric bounds of theOtherObject
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] set textFrameHMiddle to tx1 + ((tx2 - tx1) / 2)
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] set otherFrameHMiddle to ox1 + ((ox2 - ox1) / 2)
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] set horizontalDistance to textFrameHMiddle - otherFrameHMiddle
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] set verticalDistance to (ty1 - oy1) - 5.5
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] move theOtherObject by {horizontalDistance, verticalDistance}
[nbsp] [nbsp] [nbsp] [nbsp] end if
[nbsp] [nbsp] [nbsp] end tell
[nbsp] end if
end tell