Help updating Applescript to work in CC

Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / Help updating Applescript to work in CC

Viewing 2 reply threads
  • Author
    Posts
    • #86998
      kydndesigns
      Member

      Hello,
      This Script makes duplicates and re-numbers indesign spreads. I’ve gone through it and changed all reference of Indesign CS6 To CC. But I still get the error “The folder needs to contain a single InDesign CC Document of page 002.”
      Is there a specific way Indesign CC needs to be worded? Is there something else that needs to be changed?

      on open theFolder

      display dialog “How many *Pages* in the catalog?” default answer “” buttons {“Create Spreads”, “Cancel”} default button 1

      copy the result as list to {theButton, theNumber}

      if theNumber is “” then
      set theNumber to “force an error” –making the number this string will force an error in the next step
      end if

      try
      set theNumberInt to theNumber as integer –will error if the number of pages entered is a blank or some text and go to the on error section
      set divisor to (theNumberInt mod 2) – 1
      set test to 100 / divisor –will error if the number of pages entered is not an even number end go to the on error section

      tell application “Finder” to set FileList to get every item of (entire contents of folder theFolder) whose kind is “InDesign® CC Document”
      set divisor2 to count of items of FileList

      if divisor2 is not 1 then –if there’s more than 1 InDesign CC document in the folder, this will force an error
      set divisor2 to 0

      end if
      try
      set test2 to 100 / divisor2 –ok there’s one and only one InDesign CC file in the folder, keep going…
      set fileName to name of item 1 of FileList as text

      set i to 0
      repeat with i from 1 to (theNumberInt / 2) – 1
      set fileName to name of item 1 of FileList as text
      set Spot to offset of “002” in fileName
      set divisor3 to 100 / Spot
      set nameStart to text 1 thru (Spot – 1) of fileName
      set namePage to “00” & (2 * i) + 2 as text
      set namePage to characters -1 thru -3 of namePage as text
      set theFile to duplicate item 1 of FileList
      set name of theFile to nameStart & namePage & “A0.indd” as text
      end repeat
      on error
      display dialog “The folder needs to contain a single InDesign CC document of page 002.” buttons {“OK”} default button 1
      end try

      on error
      display dialog “Please enter an even number.” buttons {“OK”} default button 1
      end try

      end open

    • #86999
      Matt Isaac
      Participant

      I believe “InDesign CC” should be followed by the year. (eg. “InDesign CC 2015”)

    • #87000
      kydndesigns
      Member

      Thank You! it ended up needing to be “InDesign® CC 2015.0 Document” to get it to work

Viewing 2 reply threads
  • You must be logged in to reply to this topic.
>