Automating Adobe InDesign CC 2015

Seasons Greetings

Sunday, December 11, 2016

In keeping with the season, may we offer a fun little AppleScript script as a bonus that may leave you smiling.

Just copy the script into the AppleScript Editor and save it as an .app file on your hard drive (without options checked).

When you want to run it, make sure you have sound turned on and double-click the icon for the file.

Twelve Days of Christmas

set theCounters to {"First", "Second", "Third", "Fourth", "Fifth", "Sixth", "Seventh", "Eighth", "Ninth", "Tenth", "Eleventh", "Twelfth"}
set theCounted to {"a partridge in a pear tree.", "two turtle doves, and ", "three French hens, ", "four calling birds, ", "five golden rings, ", "six geese a-laying, ", "seven swans a-swimming, ", "eight maids a-milking, ", "nine ladies dancing, ", "ten lords a-leaping, ", "eleven pipers piping, ", "twelve drummers drumming, "}
set theseThings to {}
set countedSoFar to ""
repeat with n from 1 to 12
	set countedSoFar to item n of theCounted & countedSoFar
	set thisThing to "On the " & item n of theCounters & " Day of Christmas, my true love sent to me: " & countedSoFar
	set end of theseThings to thisThing
	say thisThing using "Victoria" with waiting until completion
end repeat

Notice how the repeat loop parses through the two lists (theCounters and theCounted), adding theCounted to countedSoFar to create the string (thisThing).

The say command is part of the User Interaction suite for Standard Additions. Take a look at the say command to see how you can change how the script is spoken. Notice that you can save the output to an AIFF file.

Have fun and enjoy the season.


I can't remember who first sent me this script, but it has been one that I have enjoyed playing with over the years.

Trackback Link
Post has no trackbacks.

Recent Posts


transform Change Text Export to PDF Numbering Find Change page items Caption Variable XML structure CALS tables Automating animations active spread coordinates save template Styling Text lists Create Document placeable user interaction level cut and paste BrdgeTalk do script Publish Online paragraph styles Checkbox Control Export HTML External Object Scripts script folder InDesign template Placing images try/on error parent page say Tables Script Preferences Document from Template AppleScript Library Folder pasteboard Document Presets Embed Document automated workflow Fixed Format ePub InDesign dialogs Adobe InDesign CC metacharacters text editbox Find by Attribute HTML Export trimText enable redraw GPS metadata CSS AppleScript dialogs fit repeat loops Table cells Sound records System Events Character Styles Choose file stylesheets Index of blogs and scripts for year 2016 automation automating InDesign handlers Excel tutorial text concatenation measurements Media Image Placement wild cards Autoflow text placement path GPS Find Text import HTML if/then Document stylesheets folder Find by Font Border Panel Video Create Text Frame ePub for Kindle Fixed Layout ePub entire path transform again find change options styles scripting Preferences Radiobutton Group new document doScript XML tags parent PDF transformation matrix table styles PDF export preferences AppleScript Templates watermark Adding Captions selection ePub for iPad import text Interactive Publications resize Apple apps Mail Custom CSS Style Sheets file paths script templates arrays Glossary massage text with timeout Repeat With images text item delimiters measurement editboxes Find by Color dropdowns Bullets InDesign CC Editbox image metadata directory Templates Custom Buttons Combobox PDF security object styles functions integer editboxes Text Cleanup Metadata Hyperlinks Choose from list Custom Dialog Read text file as list reframe import XML Enabling Groups Nested Styles XML resolve