text stringlengths 0 15.7k | source stringlengths 6 112 |
|---|---|
display dialog msg buttons {okButton} default button okButton with icon stop with title "Error" | email_signature.applescript |
if (system version of (system info) does not start with supportedOsVersion) then | email_signature.applescript |
displayError("This code only works on OS verson " & supportedOsVersion & ".*") | email_signature.applescript |
set mailboxCountComplete to false | email_signature.applescript |
if (count of accounts) is greater than 0 then | email_signature.applescript |
set mailboxCountComplete to true | email_signature.applescript |
if not mailboxCountComplete then | email_signature.applescript |
displayError("There are no Mail accounts setup. Please set up a Mail account first") | email_signature.applescript |
set fullName to text returned of (display dialog "What is your full name? (eg John Smith)" default answer "") | email_signature.applescript |
if length of fullName > 0 then | email_signature.applescript |
set emailAddress to text returned of (display dialog "What is your email address? (eg myemail@world.com)" default answer "") | email_signature.applescript |
if length of emailAddress > 0 then | email_signature.applescript |
set accountName to "" | email_signature.applescript |
repeat with eachAccount in accounts | email_signature.applescript |
if email addresses of eachAccount contains emailAddress then | email_signature.applescript |
if length of accountName = 0 then | email_signature.applescript |
displayError("There are no Mail accounts with email " & emailAddress & ". Please set up a Mail account first") | email_signature.applescript |
set mobileNumber to text returned of (display dialog "What is your mobile number? (Leave blank if you don't know)" default answer "") | email_signature.applescript |
if length of mobileNumber > 0 then | email_signature.applescript |
if the first character of mobileNumber is "0" then | email_signature.applescript |
set mobileNumber to text 2 thru (length of mobileNumber) of mobileNumber | email_signature.applescript |
if the first character of mobileNumber is not "+" then | email_signature.applescript |
set mobileNumber to "+44 " & mobileNumber | email_signature.applescript |
set websiteUrl to "https://ubxd.co/" | email_signature.applescript |
set websiteDisplayName to "ubxd.co" | email_signature.applescript |
set emailSignature to " | email_signature.applescript |
<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"width: 98%; margin-top: 10px; font-family: arial, sans;\"> | email_signature.applescript |
<td style=\"border-bottom: solid 1px black; font-size: 20px; line-height: 28px; font-family: Trebuchet MS, arial, sans\" valign=\"bottom\">" & fullName & "</td> | email_signature.applescript |
<td style=\"border-bottom: solid 1px black;\" align=\"right\"> | email_signature.applescript |
<table width=\"145px\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"width: 145px;\" align=\"right\"> | email_signature.applescript |
<td style=\"font-family: Trebuchet MS, arial, sans; font-weight: bold; font-size: 35px; color: #000000; letter-spacing: -1px; height: 27px; line-height: 27px;\" height=\"27px\" valign=\"top\" align=\"right\"> | email_signature.applescript |
Unboxed | email_signature.applescript |
</td> | email_signature.applescript |
<td style=\"font-family: Trebuchet MS, arial, sans; font-weight: bold; font-size: 30px; color: #92278F; letter-spacing: -1px; height: 42px; line-height: 27px;\" height=\"42px;\" valign=\"top\" align=\"right\"> | email_signature.applescript |
Consulting | email_signature.applescript |
<td align=\"left\" valign=\"top\" style=\"border-top: solid 4px white;\"> | email_signature.applescript |
<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"font-size: 12px; font-family: arial;\" align=\"left\"> | email_signature.applescript |
<td style=\"width: 16px; color: #92278F;\">E:</td> | email_signature.applescript |
<td> | email_signature.applescript |
<a style=\"color: black; text-dcoration: none;\" href=\"" & emailAddress & "\">" & emailAddress & "</a> | email_signature.applescript |
<td style=\"width: 16px; color: #92278F;\">M:</td> | email_signature.applescript |
<td>" & mobileNumber & "</td> | email_signature.applescript |
<td style=\"width: 16px; color: #92278F;\">T:</td> | email_signature.applescript |
<td>+44 20 3137 2940</td> | email_signature.applescript |
<td style=\"width: 16px; color: #92278F;\">F:</td> | email_signature.applescript |
<td>+44 20 7183 4251</td> | email_signature.applescript |
<td align=\"right\" style=\"font-size: 12px; font-family: arial; border-top: solid 4px white;\" valign=\"top\"> | email_signature.applescript |
<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"font-size: 12px; font-family: arial;\" align=\"right\"> | email_signature.applescript |
<td align=\"right\">17 Blossom Street</td> | email_signature.applescript |
<td align=\"right\">London, E1 6PL</td> | email_signature.applescript |
<td align=\"right\">United Kingdom</td> | email_signature.applescript |
<td align=\"right\"><a style=\"color: #92278F; text-decoration: none;\" href=\"" & websiteUrl & "\">" & websiteDisplayName & "</a></td> | email_signature.applescript |
display dialog "Error activating Mail" buttons {okButton} default button okButton cancel button okButton with title "Exit" | email_signature.applescript |
log "Deleting existing signature..." | email_signature.applescript |
delete (every signature whose name is emailSignatureName) | email_signature.applescript |
log ".. deleted" | email_signature.applescript |
displayError("Error deleting existing signature: " & errmsg) | email_signature.applescript |
log "Creating Placeholder Signature..." | email_signature.applescript |
set newSig to make new signature with properties {name:emailSignatureName, content:"PlaceHolder"} | email_signature.applescript |
set content of newSig to placeholderText | email_signature.applescript |
set selected signature to emailSignatureName | email_signature.applescript |
tell application "System Events" to keystroke "," using command down | email_signature.applescript |
log "... placeholder created" | email_signature.applescript |
displayError(errmsg) | email_signature.applescript |
log "Waiting for mail to exit" | email_signature.applescript |
set signaturePath to ((path to library folder from user domain) as text) & "Mobile Documents:com~apple~mail:Data:MailData:Signatures:" | email_signature.applescript |
if not (exists signaturePath) then | email_signature.applescript |
set signaturePath to ((path to library folder from user domain) as text) & "Mail:V2:MailData:Signatures:" | email_signature.applescript |
set signaturePath to ((path to library folder from user domain) as text) & "Mail:MailData:Signatures:" | email_signature.applescript |
set mailSignatureFile to item 1 of reverse of (sort (every file of alias signaturePath whose name ends with ".mailsignature") by modification date) as alias | email_signature.applescript |
set mailSignatureFilePosix to POSIX path of mailSignatureFile | email_signature.applescript |
set the mailSignatureOpenFile to open for access mailSignatureFilePosix with write permission | email_signature.applescript |
set signatureText to read mailSignatureOpenFile | email_signature.applescript |
set signatureText to get replaceText(placeholderText, emailSignature, signatureText) | email_signature.applescript |
set eof mailSignatureOpenFile to 0 | email_signature.applescript |
write signatureText to mailSignatureOpenFile starting at 0 | email_signature.applescript |
close access mailSignatureOpenFile | email_signature.applescript |
display dialog "It worked! | email_signature.applescript |
Emails sent from Mail should now have your new signature" buttons {okButton} default button okButton with title "Exit" with icon note giving up after 30 | email_signature.applescript |
on openCamTwist() | camtwist.applescript |
tell application "CamTwist" | camtwist.applescript |
end openCamTwist | camtwist.applescript |
on loadCamTwist() | camtwist.applescript |
loadSetup("test") | camtwist.applescript |
tell application "System Events" to set visible of process "CamTwist" to false | camtwist.applescript |
end loadCamTwist | camtwist.applescript |
on closeCamTwist() | camtwist.applescript |
tell application "CamTwist" to quit | camtwist.applescript |
end closeCamTwist | camtwist.applescript |
set helpStr to "Usage: camtwist.applescript[(open|load|close)]" | camtwist.applescript |
if action is equal to "open" then | camtwist.applescript |
openCamTwist() | camtwist.applescript |
else if action is equal to "close" then | camtwist.applescript |
closeCamTwist() | camtwist.applescript |
else if action is equal to "load" then | camtwist.applescript |
loadCamTwist() | camtwist.applescript |
to makeAlert for messageText given infoText:infoText : (missing value), buttons:buttons : {"OK"}, icon:icon : missing value, showing:showing : false | NSAlert.applescript |
if messageText is not missing value then its setMessageText:(messageText as text) | NSAlert.applescript |
if infoText is not missing value then its setInformativeText:(infoText as text) | NSAlert.applescript |
repeat with aButton in (buttons as list) | NSAlert.applescript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.