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

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

Archive