Skip to content

Instantly share code, notes, and snippets.

@benwaldie
Created December 2, 2013 20:45
Show Gist options
  • Save benwaldie/7758669 to your computer and use it in GitHub Desktop.
Save benwaldie/7758669 to your computer and use it in GitHub Desktop.
Get the address from a selected contact and add it to a Pages '09 document, right aligned, with the date.
tell application "Contacts"
set theSelection to selection
set thePerson to item 1 of theSelection
set theAddress to address 1 of thePerson
set theAddressText to formatted address of theAddress
end tell
set theDate to short date string of (current date)
tell application "Pages"
tell document 1
set theText to make new paragraph at end of body text with data theDate & return & theAddressText
set alignment of theText to right
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment