2 Replies Latest reply on Aug 10, 2009 12:12 AM by J van E

    CS4: exporting text

    J van E Level 1

      For CS3 I had a script that exported text from frames I'd put a scriptlabel on. The default CS4 text export function nor the text export sample script that comes with CS4 don't do the trick. Does anyone know if there is a similar script for CS4 available somewhere? Or maybe someone knows how to alter this one? I get an error with the file path...

       

      set allText to {}

      set oldTids to AppleScript's text item delimiters

      on changetid(x)

      set AppleScript's text item delimiters to x

      end changetid

       

      tell application "Adobe InDesign CS3"

      my changetid("")

      set filePath to file path of document 1

      set docname to (name of front document & ".txt")

      try

      tell application "Finder"

      make new file at filePath with properties {name:docname}

      end tell

      end try

      set newName to (filePath & docname) as string as alias

      set theNumber to (text returned of (display dialog "How many stories do you want to export" default answer "3"))

      set theNumber to theNumber as integer

      repeat with ii from 1 to theNumber

      set y to (parent story of every text frame of document 1 whose label is ii as string)

      set x to (get text of y)

      set end of allText to (x & return & return)

      end repeat

      set allText to every item of allText as text

      set writeOut to open for access newName with write permission

      write allText to writeOut

      close access writeOut

      my changetid(oldTids)

      end tell