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.

Credits

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
http://www.yourscriptdoctor.com/BlogRetrieve.aspx?BlogID=18153&PostID=1484762&A=Trackback
Trackbacks
Post has no trackbacks.

Recent Posts


Tags

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

Archive