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

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

Archive