global datamapp, mallmapp, bildmapp, utmappen set datafil to getFormVariable "data" set mallfil to getFormVariable "mall" tell application "Finder" my mysetup() set AppleScript's text item delimiters to return set dataToRunList to every text item of (read file (datamapp & datafil)) set dataToRunListCount to count of items of dataToRunList set rubriker to item 1 of dataToRunList set sidan to 1 set produkten to 1 set AppleScript's text item delimiters to ";" set rubrikerList to every text item of rubriker tell application "Adobe InDesign CS3" set user interaction level of script preferences to never interact open (mallmapp & mallfil) showing window false duplicate page 1 of document 1 end tell repeat with x from 2 to dataToRunListCount set dennaraden to item x of dataToRunList tell application "Adobe InDesign CS3" set kolumnen to 1 set find text preferences to nothing set change text preferences to nothing repeat with rubriken in rubrikerList try set rubriken to (rubriken as text) set radcontent to ((text item kolumnen of dennaraden) as text) if rubriken contains "bild" or rubriken contains "logo" then place (bildmapp & radcontent) on rectangle rubriken of group ("mall" & produkten) of page sidan of document 1 else set find what of find text preferences to ("<" & rubriken & ">") set change to of change text preferences to (radcontent) tell text frame 1 of group ("mall" & produkten) of page sidan of document 1 to change text end if end try set kolumnen to kolumnen + 1 end repeat set produkten to produkten + 1 if produkten = 10 then duplicate page (sidan + 1) of document 1 set sidan to sidan + 1 set produkten to 1 end if end tell end repeat tell application "Adobe InDesign CS3" delete last page of document 1 save document 1 to (utmappen & "evighet.indd") --export document 1 to (utmappen & "evighet.pdf") using "Smallest File Size" without showing options close document 1 saving yes end tell end tell --AVSLUT return ("Indesign-file") on mysetup() set datamapp to "Macintosh HD:Users:ftp:VirtualUsers:generator:data:" set mallmapp to "Macintosh HD:Users:ftp:VirtualUsers:generator:mall:" set bildmapp to "Macintosh HD:Users:ftp:VirtualUsers:generator:bilder:" set utmappen to "Macintosh HD:Library:WebServer:Documents:cexp:klart:" end mysetup