Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

cymro

macrumors newbie
Original poster
May 23, 2008
17
0
Hi,
At the bottom of letters I write I would like to include random facts about the company. Rather than copying and pasting a random fact - I was wondering if anybody knows of a way to add random text to the footer of a Pages or word document?
 
You could create an AppleScript that would read in a datafile of random facts. Script would calculate the number of paragraphs, get a random number from the number of graphs, then pluck that random number graph into a variable.

Then the script would launch your word processor and send a command something like: set footer to aVariable.

Here's a bit of code in Pages:

Code:
tell application "Pages"
	set odd footer of section 1 of document 1 to "random bit of text"
end tell

(You can't set the footer directly in Pages, you need to set the odd footer then the even footer, apparently)

Which word processor are you using?

mt
 
Hi - thanks for your answer. I use both word and pages - though prefer pages. I am a little unsure of scripts though! thanks again!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.