text
stringlengths
0
15.7k
source
stringlengths
6
112
set TOCText to TOCText & return & tab & ¬
lns3.scpt
(item sectionTitleCounter of sourceDocumentSectionNames) & ¬
lns3.scpt
tab & sectionStartPageIndex
lns3.scpt
set sectionTitleCounter to sectionTitleCounter + 1
lns3.scpt
set x to x + (count of pages of section i)
lns3.scpt
set body text of section 2 to TOCText
lns3.scpt
tell body text of section 2
lns3.scpt
tell paragraph 1
lns3.scpt
set font to defaultTOCTitleTypeFace
lns3.scpt
set size to defaultTOCTitleTypeSize
lns3.scpt
set color of it to defaultTOCTitleTypeColor
lns3.scpt
tell paragraphs 2 thru -1
lns3.scpt
set font to defaultTOCItemTypeFace
lns3.scpt
set size to defaultTOCItemTypeSize
lns3.scpt
set color of it to defaultTOCItemTypeColor
lns3.scpt
my goToPage(1)
lns3.scpt
my displayThisNotification("OmniOutliner to Pages", "Document created.", "")
lns3.scpt
on textItemsToText(textItems)
lns3.scpt
set AppleScript's text item delimiters to (return & return) -- double spaced
lns3.scpt
set the textBlock to textItems as string
lns3.scpt
return textBlock
lns3.scpt
end textItemsToText
lns3.scpt
on displayThisNotification(thisTitle, thisNotification, thisSubtitle)
lns3.scpt
display notification thisNotification with title thisTitle subtitle thisSubtitle
lns3.scpt
end displayThisNotification
lns3.scpt
on goToPage(pageIndex)
lns3.scpt
tell page pageIndex
lns3.scpt
set thisShape to ¬
lns3.scpt
make new shape with properties ¬
lns3.scpt
{height:12, width:12, position:{0, 0}}
lns3.scpt
delete thisShape
lns3.scpt
end goToPage
lns3.scpt
property senderFirstNamePlaceholder : "SENDERFIRSTNAME"
lns3.scpt
property senderLastNamePlaceholder : "SENDERLASTNAME"
lns3.scpt
property senderEmailAddressPlaceholder : "SENDEREMAILADDRESS"
lns3.scpt
property senderFullAddressPlaceholder : "SENDERFULLADDRESS"
lns3.scpt
property senderPhoneNumberPlaceholder : "SENDERPHONENUMBER"
lns3.scpt
property recipientFirstNamePlaceholder : "RECIPIENTFIRSTNAME"
lns3.scpt
property recipientLastNamePlaceholder : "RECIPIENTLASTNAME"
lns3.scpt
property recipientFullAddressPlaceholder : "RECIPIENTFULLADDRESS"
lns3.scpt
property attemptMailSend : false
lns3.scpt
property requireRecipientAddress : false
lns3.scpt
global peopleCount, recipientGroup
lns3.scpt
if attemptMailSend is false then
lns3.scpt
set autoSendState to "OFF"
lns3.scpt
set autoSendState to "ON"
lns3.scpt
display dialog "This script will perform a Mail Merge between a Pages tagged-template and a chosen Contacts group." & return & return & "Contact data requirements for the sender are: First Name, Last Name, eMail Address, Mailing Address, and phone." & return & return & "Contact data requirements for recipients are: First Name, Last Name, and eMail Address." & return & return & "AUTO-SEND: " & autoSendState with icon 1 buttons {"Cancel", "Set Prefs", "Begin"} default button 3
lns3.scpt
if the button returned of the result is "Begin" then
lns3.scpt
display dialog "Set AUTO-SEND to:" buttons {"Cancel", "OFF", "ON"} default button autoSendState
lns3.scpt
if the button returned of the result is "OFF" then
lns3.scpt
set attemptMailSend to false
lns3.scpt
set attemptMailSend to true
lns3.scpt
set thisPerson to my card
lns3.scpt
if thisPerson is missing value then error number 10000
lns3.scpt
tell thisPerson
lns3.scpt
set senderFirstName to first name
lns3.scpt
set senderLastName to last name
lns3.scpt
if senderFirstName is missing value or senderLastName is missing value then
lns3.scpt
error number 10001
lns3.scpt
set the emailCount to the count of emails
lns3.scpt
if the emailCount is 0 then
lns3.scpt
error number 10002
lns3.scpt
else if the emailCount is 1 then
lns3.scpt
set senderEmailAddress to the value of first email
lns3.scpt
else -- multiple email addresses, prompt the user to pick one
lns3.scpt
set theseEmailAddress to the value of every email
lns3.scpt
set senderEmailAddress to ¬
lns3.scpt
(choose from list theseEmailAddress with prompt ¬
lns3.scpt
"Pick the sender email address to use:" default items (item 1 of theseEmailAddress))
lns3.scpt
if senderEmailAddress is false then error number -128
lns3.scpt
set senderEmailAddress to senderEmailAddress as string
lns3.scpt
set the addressCount to the count of addresses
lns3.scpt
if the addressCount is 0 then
lns3.scpt
error number 10003
lns3.scpt
else if the addressCount is 1 then
lns3.scpt
set senderAddress to the formatted address of the first address
lns3.scpt
else -- multiple addresses, prompt the user to pick one
lns3.scpt
set theseAddresses to the formatted address of every address
lns3.scpt
set senderAddress to ¬
lns3.scpt
(choose from list theseAddresses with prompt ¬
lns3.scpt
"Pick the sender address to use:" default items (item 1 of theseAddresses))
lns3.scpt
if senderAddress is false then error number -128
lns3.scpt
set senderAddress to senderAddress as string
lns3.scpt
set the phoneCount to the count of phones
lns3.scpt
if the phoneCount is 0 then
lns3.scpt
error number 10004
lns3.scpt
else if the phoneCount is 1 then
lns3.scpt
set senderPhoneNumber to the value of first phone of it
lns3.scpt
else -- multiple phone numbers, prompt the user to pick one
lns3.scpt
set thesePhoneNumbers to the value of every phone
lns3.scpt
set senderPhoneNumber to ¬
lns3.scpt
(choose from list thesePhoneNumbers with prompt ¬
lns3.scpt
"Pick the sender phone number to use:" default items (item 1 of thesePhoneNumbers))
lns3.scpt
if senderPhoneNumber is false then error number -128
lns3.scpt
set senderPhoneNumber to senderPhoneNumber as string
lns3.scpt
set groupCount to count of groups
lns3.scpt
if the groupCount is 0 then
lns3.scpt
error number 10005
lns3.scpt
else if the groupCount is 1 then
lns3.scpt
set recipientGroup to group 1
lns3.scpt