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

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

Archive