Hallo,
ich hab in meinem Dokument ungefähr 800 verankerte Textrahmen mit Randziffern. Bei diesen Randziffern sind nun einige dazugekommen und auch welche weggefallen. Ich möchte ein Script schreiben, dass diese Randziffern nun neu vergibt, damit ich die Nummern nicht von Hand ändern muss.
Aber ich bekomme es irgendwie nicht hin auf die Texte in den verankerten Rahmen zu zugreifen.
Als Object Referece bekomme ich immer so etwas:
{text frame id 526921 of text from character 89 to character 89 of story id 323 of document "LAYOUT.indd", text frame id 526898 of text from character 483 to character 483 of story id 323 of document "LAYOUT.indd", text frame id 526864 of text from character 598 to character 598 of story id 323 of document "LAYOUT.indd", text frame id 526840 of text from character 1004 to character 1004 of story id 323 of document "LAYOUT.indd"}
Mein Skript sieht so aus:
on setmydocument()
try
tell application "Adobe InDesign CS2"
set myDocument to active document
end tell
on error
display dialog "Es ist kein Indesign Dokument geöffnet. Script wird beendet." buttons ("OK")
set myDocument to false
end try
return myDocument
end setmydocument
on reNumberRZ(myDocument, myMainframe, myRZCounter, myPage)
tell application "Adobe InDesign CS2"
tell myDocument
set allPages to every page
repeat with myPage in allPages
tell text frame myMainframe of myPage
set myAnchordObjectList to every text frame
return myAnchordObjectList
log (count of myAnchordObjectList)
repeat with myItem in myAnchordObjectList
if label of myItem is "randziffer" then
tell myItem
set contents to myRZCounter
end tell
set myRZCounter to myRZCounter + 1
end if
end repeat
end tell
end repeat
end tell
end tell
end reNumberRZ
set myDocument to setmydocument()
set myMainframe to "Maintextframe"
set myRZCounter to 12
set myPage to 1
set myAnchordObjectList to reNumberRZ(myDocument, myMainframe, myRZCounter, myPage)
Vielen Dank für die Hilfe
(Dieser Beitrag wurde von crashtron am 30. Mär 2006, 14:21 geändert)