Help updating Applescript to work in CC
Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / Help updating Applescript to work in CC
- This topic has 2 replies, 2 voices, and was last updated 7 years, 8 months ago by kydndesigns.
-
AuthorPosts
-
-
July 29, 2016 at 4:35 am #86998kydndesignsMember
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 iftry
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 sectiontell 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 FileListif 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 0end 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 textset 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 tryon error
display dialog “Please enter an even number.” buttons {“OK”} default button 1
end tryend open
-
July 29, 2016 at 6:25 am #86999Matt IsaacParticipant
I believe “InDesign CC” should be followed by the year. (eg. “InDesign CC 2015”)
-
July 29, 2016 at 7:30 am #87000kydndesignsMember
Thank You! it ended up needing to be “InDesign® CC 2015.0 Document” to get it to work
-
-
AuthorPosts
- You must be logged in to reply to this topic.