Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set a to "
- "
- tell application "RagTime 6"
- activate
- set theSelection to (choose file {} with multiple selections allowed)
- set i to 1
- set theAnzahl to number of items in theSelection
- open layout 1 of document 1
- repeat with i from i to theAnzahl
- set theFile to item i of theSelection as text
- tell application "System Events"
- tell XML element 1 of contents of XML file theFile
- set vorname to (value of (XML elements whose name is "vorname")) as string
- set nachname to (value of (XML elements whose name is "name")) as string
- set geburtstag to (value of (XML elements whose name is "geb")) as string
- set kommentare to (value of (XML elements whose name is "kommentare")) as string
- set spitznamen to (value of (XML elements whose name is "stbr1")) as string
- set leistungsk to (value of (XML elements whose name is "stbr2")) as string
- set lebensmotto to (value of (XML elements whose name is "stbr3")) as string
- set hobbies to (value of (XML elements whose name is "stbr4")) as string
- set ichmag to (value of (XML elements whose name is "stbr5")) as string
- set ichmagnicht to (value of (XML elements whose name is "stbr6")) as string
- set unvergesslich to (value of (XML elements whose name is "stbr7")) as string
- set nachdemabi to (value of (XML elements whose name is "stbr8")) as string
- set jahreschule to (value of (XML elements whose name is "stbr9")) as string
- end tell
- end tell
- if i > 1 then
- make new page at after page (i - 1) of layout 1 of document 1
- end if
- tell document 1
- make new text flow at end with properties {name:"Steckbrief_" & i}
- tell text flow ("Steckbrief_" & i)
- make new paragraph at end with data "Hobbies: " & hobbies
- make new paragraph at end with data "Ich mag: " & ichmag
- make new paragraph at end with data "Ich mag nicht: " & ichmagnicht
- make new paragraph at end with data "Unvergessliche Momente: " & unvergesslich
- make new paragraph at end with data "Nach dem Abi: " & nachdemabi
- make new paragraph at end with data "12 Jahre Schule waren: " & jahreschule
- set font to "EspinosaNova-Regular"
- repeat with p from 1 to (count paragraphs)
- repeat with w from 1 to (count characters in paragraph p)
- set style of character w of paragraph p to bold
- if (character w of paragraph p as text) = ":" then
- exit repeat
- end if
- end repeat
- end repeat
- end tell
- set contents of rectangle "SteckbriefL" of page i of layout 1 to text flow ("Steckbrief_" & i)
- make new text flow at end with properties {name:"Details_" & i}
- tell text flow ("Details_" & i)
- make new paragraph at end with data "Spitznamen: " & spitznamen
- make new paragraph at end with data "Geburtstag: " & geburtstag
- make new paragraph at end with data "Leistungskurse: " & leistungsk
- set font to "EspinosaNova-Regular"
- repeat with p from 1 to (count paragraphs)
- repeat with w from 1 to (count characters in paragraph p)
- set style of character w of paragraph p to bold
- if (character w of paragraph p as text) = ":" then
- exit repeat
- end if
- end repeat
- end repeat
- end tell
- set contents of rectangle "Details" of page i of layout 1 to text flow ("Details_" & i)
- make new text flow at end with properties {name:"Kommentare_" & i}
- tell text flow ("Kommentare_" & i)
- make new paragraph at end with data "Kommentare der Stufe: " & kommentare
- set font to "EspinosaNova-Regular"
- repeat with p from 1 to (count paragraphs)
- repeat with w from 1 to (count characters in paragraph p)
- set style of character w of paragraph p to bold
- if (character w of paragraph p as text) = ":" then
- exit repeat
- end if
- end repeat
- end repeat
- end tell
- set contents of rectangle "Kommentare" of page i of layout 1 to text flow ("Kommentare_" & i)
- make new text flow at end with properties {name:"Name_" & i}
- tell text flow ("Name_" & i)
- make new paragraph at end with data vorname & " " & nachname
- set font to "EspinosaNova-Regular"
- set style of paragraph 1 to bold
- set size of paragraph 1 to 24
- end tell
- set contents of rectangle "Name" of page i of layout 1 to text flow ("Name_" & i)
- end tell
- set contents of rectangle "Bild" of page i of layout 1 of document 1 to file ":Users:User_01:Desktop:dummyPic.jpeg"
- end repeat
- end tell
Advertisement
Add Comment
Please, Sign In to add comment