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

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

Archive