2 Replies Latest reply on Mar 3, 2009 6:52 PM by Kevin Parrott

    [AS] saving,  different name, different location

    Kevin Parrott Level 2
      Hi

      I have a Indesign CS3 file saved as a template, what I am trying to do is save the template as a document in a different place with a different name.

      I have the below which works fine, but I have to paste the file name into the text field (which is stored on the clipboard) thrown via the prompt "save document 1 to (choose file name)", and manually choose a destination to save to.

      I have the name of the new file, I have a new location for the file, but I am uncertain as
      to how to go about executing a script to do what I am seeking, any help appreciated please.

      -----------------------
      tell application "Adobe InDesign CS3"
      activate
      set myDoc to active document
      set Doc_Width to page width of document preferences of myDoc
      set Doc_Height to page height of document preferences of myDoc
      set _W to round {(Doc_Width)} as number
      set _X to result
      set _Y to round {(Doc_Height)} as number
      set _Z to result
      -------------
      if (_Z is "241" as number) and (_X is "311" as number) then
      set _H to "H"
      -------------
      end if
      end tell
      set _folders to (folders of desktop whose name begins with "Q")
      repeat with _folder in _folders
      set _Name to name of _folder
      count words of _Name
      if the result is 2 then
      set _NewName to (text 2 thru 7 of _Name) & (text 9 thru -1 of _Name)
      else
      set _NewName to (text 2 thru -1 of _Name)
      end if
      end repeat
      set the clipboard to _NewName & "-" & _H as string

      tell application "Adobe InDesign CS3"
      save document 1 to (choose file name)
      end tell
      end tell
      ------------------------

      Kev