Hallo TMA,
hier schon mal ein Script. Entwickelt unter CS2 und getestet mit drei einfachen Textrahmen, welche je fünf Absätze enthalten.
[edit: Das Beschränken auf die Auswahl habe ich nachträglich eingefügt.]
tell document 1 of application "Adobe InDesign CS2"
[nbsp] activate
[nbsp]
[nbsp] try
[nbsp] [nbsp] set allIDs to id of every item of selection ¬
[nbsp] [nbsp] [nbsp] whose content type is text type
[nbsp] on error
[nbsp] [nbsp] display dialog "Es ist kein Textrahmen ausgewählt." buttons ¬
[nbsp] [nbsp] [nbsp] "OK" default button 1 with icon 2
[nbsp] [nbsp] error number -128
[nbsp] end try
[nbsp]
[nbsp] repeat with i from 1 to count of allIDs
[nbsp] [nbsp] set baseID to item i of allIDs
[nbsp] [nbsp]
[nbsp] [nbsp] set idList to {}
[nbsp] [nbsp] set baseList to {}
[nbsp] [nbsp]
[nbsp] [nbsp] repeat 1 times
[nbsp] [nbsp] [nbsp]
[nbsp] [nbsp] [nbsp] tell text frame id baseID
[nbsp] [nbsp] [nbsp] [nbsp] set nParas to count of paragraphs of parent story
[nbsp] [nbsp] [nbsp] [nbsp] if nParas is 0 then exit repeat
[nbsp] [nbsp] [nbsp] end tell
[nbsp] [nbsp] [nbsp]
[nbsp] [nbsp] [nbsp] repeat with k from 2 to nParas
[nbsp] [nbsp] [nbsp] [nbsp] tell text frame id baseID
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] tell parent story
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] tell paragraph k
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] set end of baseList to baseline of line 1
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] end tell
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] end tell
[nbsp] [nbsp] [nbsp] [nbsp] end tell
[nbsp] [nbsp] [nbsp] [nbsp]
[nbsp] [nbsp] [nbsp] [nbsp] set newFrame to duplicate text frame id baseID
[nbsp] [nbsp] [nbsp] [nbsp] set end of idList to id of newFrame
[nbsp] [nbsp] [nbsp] [nbsp] tell newFrame
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] tell parent story
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] try
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] delete (paragraphs (k + 1) thru -1)
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] end try
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] try
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] delete (paragraphs 1 thru -2)
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] end try
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] if (count of characters) is greater than 1 then
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] if contents of character -1 is return then
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] delete character -1
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] end if
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] end if
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] end tell
[nbsp] [nbsp] [nbsp] [nbsp] end tell
[nbsp] [nbsp] [nbsp] end repeat
[nbsp] [nbsp] [nbsp]
[nbsp] [nbsp] [nbsp] tell text frame id baseID
[nbsp] [nbsp] [nbsp] [nbsp] set {y1, x1, y2, x2} to geometric bounds
[nbsp] [nbsp] [nbsp] [nbsp] tell parent story
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] try
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] delete (paragraphs 2 thru -1)
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] end try
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] if contents of character -1 is return then
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] delete character -1
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] end if
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] set y2 to (baseline of line -1) + 1
[nbsp] [nbsp] [nbsp] [nbsp] end tell
[nbsp] [nbsp] [nbsp] [nbsp] set geometric bounds to {y1, x1, y2, x2}
[nbsp] [nbsp] [nbsp] end tell
[nbsp] [nbsp] [nbsp]
[nbsp] [nbsp] [nbsp] repeat with k from 1 to count of idList
[nbsp] [nbsp] [nbsp] [nbsp] set curID to item k of idList
[nbsp] [nbsp] [nbsp] [nbsp] tell text frame id curID
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] set {y1, x1, y2, x2} to geometric bounds
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] tell parent story
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] set yDiff to (item k of baseList) - (baseline of line 1)
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] [nbsp] set y2 to (baseline of line -1) + 1
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] end tell
[nbsp] [nbsp] [nbsp] [nbsp] [nbsp] set geometric bounds to {y1, x1, y2, x2}
[nbsp] [nbsp] [nbsp] [nbsp] end tell
[nbsp] [nbsp] [nbsp] [nbsp] move text frame id curID by {0, yDiff}
[nbsp] [nbsp] [nbsp] end repeat
[nbsp] [nbsp] [nbsp]
[nbsp] [nbsp] end repeat
[nbsp] end repeat
end tell
In dieser ersten Version ist nur ein Minimum an Fehlervorbeugung eingebaut. Es gibt bestimmt noch weitere Fallstricke vorauszusehen (z.B. Rahmen mit Übersatz, bei welchem die erste Zeile eines Absatzes nicht sichtbar ist).
Gruss, Hans