(* October 6, 2020 This script synchronizes continuous footnote numbers throughout the documents of an InDesign book, optionally syncing "Type > Document Footnote Options" as well. Save it as an application in "~/Library/Preferences/Adobe InDesign/Version 15.0/en_US/Scripts/Scripts Panel", "~/Library/Scripts/Applications/InDesign", or alias it from one to the other for both. It's rough and lacks any error checking, and I make no claims as to its efficacy or reliability. It works for me, but as always with gifts, run it on a backup of your project. The placing of inline comments is specific to my AppleScript editor and will likely be a mess anywhere else. No doubt you can work it out. *) --» INIT --▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ use AppleScript version "2.4" -- Yosemite (10.10) or later use scripting additions --   Configurable Options --▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ property startingFootnoteNumber : 1 --   Initialize --▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ set progress description to "Synchronizing Footnotes" -- initialize progress bar set progress additional description to "Preparing…" -- update progress bar property syncFootnoteOptions : false -- default to not syncing options. --» RUN --▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ tell application "Adobe InDesign 2020" --    Prepare --▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ set progress total steps of me to count (book contents of front book) -- progress by book content --──────────────────────────────────────────────────────────────────────────── Get Needed Style Source Attributes set styleSourceDoc to open ¬ (full name of style source document of front book) ¬ without showing window -- open style source doc in background set doIt to "/usr/bin/basename " & ¬ quote & name of styleSourceDoc & quote & " .indd" set styleSourceDocName to name of styleSourceDoc -- get style source doc name set styleSourceDocBaseName to do shell script "/usr/bin/basename " & ¬ quote & styleSourceDocName & quote & " .indd" -- strip extension for use in dialogs set footnoteOptions to Get_Set_Footnote_Options of me for styleSourceDoc -- get style source footnote opts, just in case tell styleSourceDoc to close saving no -- close the doc --──────────────────────────────────────────────────────────────────────────── Shall We Sync Footnote Options? set dialogResponse to display dialog ¬ "Synchronize Document Footnote Options with style source document " & ¬ quote & styleSourceDocBaseName & quote & ¬ " as well as renumber foonotes?" buttons {"Yes", "No", "Cancel"} ¬ default button "No" cancel button "Cancel" with title "Synchronize Options" if button returned of dialogResponse is "Yes" then set syncFootnoteOptions to true end if --   Run --▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ set bookContents to ¬ every book content of front book where name is not styleSourceDocName -- leave style source doc out of it repeat with thisContent in bookContents -- iterate book contents set thisDocument to ¬ (open (full name of thisContent) without showing window) -- open document for this book content set docName to do shell script "/usr/bin/basename " & ¬ quote & name of thisContent & quote & " .indd" -- get base name of this doc for progress desc. tell thisDocument set progress additional description of me to ¬ "Synchronizing '" & docName & "'…" -- display progress status --────────────────────────────────────────────────────────────────────── Options if syncFootnoteOptions then Get_Set_Footnote_Options of me ¬ from footnoteOptions for thisDocument -- if requested, sync footnote options --────────────────────────────────────────────────────────────────────── Footnote Starting Number set theFootnotes to footnotes of every story set startingFootnoteNumber to ¬ startingFootnoteNumber + (count theFootnotes) set start at of footnote options to startingFootnoteNumber close saving yes -- close & save changes end tell set (progress completed steps of me) to ¬ (progress completed steps of me) + 1 -- update progress. end repeat end tell --» HANDLERS --▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ --   Get_Set_Footnote_Options from {footnote options} for thisDocument -- ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ (* The units used in footnote options are dependent on the unit pref settings of the document, and the documents in a book may have different unit settings. Rather than calculate for all possible units, it's simplest just to temporarily set the document to a standard unit (e.g., points) while getting/setting options, then restore it to its original setting. *) to Get_Set_Footnote_Options from theseOptions : {} for thisDocument -- theseOptions is an optional parameter, -- unused when getting options --local thisDocument, horizontalUnits, verticalUnits, footnoteOptions-- debug only tell application "Adobe InDesign 2020" to tell thisDocument --────────────────────────────────────────────────────────────────── save current settings set horizontalUnits to ¬ horizontal measurement units of view preferences set verticalUnits to ¬ vertical measurement units of view preferences --────────────────────────────────────────────────────────────────── set to points for consistent measurement set horizontal measurement units of ¬ view preferences of thisDocument to points set vertical measurement units of ¬ view preferences of thisDocument to points --────────────────────────────────────────────────────────────────── do the work if theseOptions ≠ {} then -- set the document's options, otherwise… set properties of footnote options to theseOptions set start at of footnote options to startingFootnoteNumber else set theseOptions to properties of footnote options -- …get them end if --────────────────────────────────────────────────────────────────── restore previous settings set horizontal measurement units of ¬ view preferences to horizontalUnits -- set vertical measurement units of ¬ view preferences to verticalUnits end tell return theseOptions -- return provided or gotten options, depending end Get_Set_Footnote_Options