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

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

Archive