Scribe Document Object Modal

About
This document describes the Scribe Document Object Model which is to address fields inside objects. Fields can be used in filters, templates, item preview and scripts. Each object in Scribe will export a number of fields that can either be values or references to other objects. If you try and reference an Object that doesn't exist then the value returned will be NULL.

The following object descriptions are in the format of:

Type Name
The type is either an Object::Type meaning it's an object of the specified type and has sub-fields, otherwise it's a simple type that has no sub-fields. If the type ends in "[]" the value returned is an array and must be indexed to retreive an actual value.


Mail Fields

Object::Address From
Object::Address[] To
String Subject
Int Size Size in bytes of body and attachments.
String MessageID
String InternetHeaders All the headers
String[] InternetHeader A specific header, e.g. InternetHeader["Subject"]
Int Priority 1=Low, 3=Normal, 5=High
String Body The text version of the message. You can optionally use brackets to extract a internet style header from the body. e.g. Body["Foo"] would return the string 'Bar' if the message's text was:
Gah: Fob
Boo: Magh
Foo: Bar
Roob: Maar bro hoo

String BodyAsText The text part if present, or a text version of a HTML only email. Html -> Text conversion is rough at best. This is used primarily by the reply and forward functions to give the user something to reply/forward with if the message is HTML only.

Another great use for this field is filtering HTML spam mail. Which often tries to put tags and comments inside a word to stop word based filters triggering. This field removes those tags and comments and allows you to check just the text of the mail, which works rather well.

String Html The HTML version of the message if any. Otherwise NULL.
String DateSent
String DateReceived
Int Flags Various state flags:
#define MAIL_SENT               0x00000001
#define MAIL_RECEIVED           0x00000002
#define MAIL_CREATED            0x00000004 // Means the message is editable.
#define MAIL_FORWARDED          0x00000008
#define MAIL_REPLIED            0x00000010
#define MAIL_ATTACHMENTS        0x00000020
#define MAIL_READ               0x00000040
#define MAIL_MARK               0x00000080
#define MAIL_READY_TO_SEND      0x00000100 // If this flag is set then the user
                                           // wants to send the mail on the next
                                           // run. When the user just saves a new
                                           // message in the outbox this isn't set
                                           // and isn't sent until they go in and
                                           // say "send". At which point this flag
                                           // is set and the message sent.
#define MAIL_READ_RECEIPT       0x00000200
#define MAIL_IGNORE             0x00000400
#define MAIL_FIXED_WIDTH_FONT   0x00000800
#define MAIL_BOUNCED            0x00001000  // The bounce source mail
#define MAIL_BOUNCE             0x00002000  // The outgoing copy of a bounced mail
#define MAIL_SHOW_IMAGES        0x00004000  // User selected to show images in HTML
#define MAIL_BAYES_HAM          0x00010000  // Bayesian classified originally as ham
#define MAIL_BAYES_SPAM         0x00020000  // Bayesian classified originally as spam
						
You can access all the flags with this field, or by using the array operator access a single flag, e.g.:
mail.Flags[MAIL_READ]
Object::Mail Mail The email being replied to / forwarded
String Sig The signature associated with the account that this mail was received on, or the default signature when there is no received account. "Reply with sig" must be switched on the in the options for the field to return something.
Boolean Read True if the mail has been read
Int Colour The RGBA32 colour.
Boolean Selected True if the mail is selected in the list view.
Boolean ShowImages True if the HTML images are shown.
String Folder The location of the Mail
Object::Scribe Scribe Pointer to the app class.

Contact Feilds

String FirstName
String SurName
String Email
String Nick
String Spouse
String Note
String Street
String Suburb
String Postcode
String State
String Country
String Home
String Mobile
String ICQ
String Fax
String WebPage
String WkStreet
String WkSuburb
String WkPostcode
String WkState
String WkCountry
String Work
String WkMobile
String WkIM
String WkFax
String WkWebPage
String Company
String <Custom Field 1> or CustomVal1
String <Custom Field 2> or CustomVal2
String <Custom Field 3> or CustomVal3
String <Custom Field 4> or CustomVal4
String Folder The path of the folder holding the Contact.
String[] Groups A list of the names of the Groups containing this Contact.
Object::Scribe Scribe

Address Feilds

String Name
String Email
Int Type To=0, Cc=1, Bcc=2
String[] Groups A list of the names of the Groups containing this email address.
Object::Contact Contact

Filter Feilds

String Name
Object::Mail Mail The email currently being filtered.
Object::Scribe Scribe

Scribe Feilds

String Home The directory Scribe is running from.
String Quote The "Quote when replying with ???" value from the options.
String Now The current date and time.
Object::Folder CurrentFolder The currently selected folder.
Object::Folder Folder["name"] A loaded folder. Pass the path in the array parameter. Or an integer where:
  • 0 = Inbox
  • 1 = Outbox
  • 2 = Sent
  • 3 = Trash
  • 4 = Contacts
  • 5 = Templates
  • 6 = Filters
  • 7 = Calendar

Folder Feilds

String Name The leaf name of the folder.
String Path The full path of the folder.
Int Unread The number of unread mail in the folder.
Int Length The number of things in the folder.
List Item An array of items in the folder.
Int Type The type of things in the folder.
  • MAGIC_MAIL = 0xaaff0001 // Mail item
  • MAGIC_CONTACT = 0xaaff0002 // Contact item
  • MAGIC_FOLDER = 0xaaff0003 // Folder of items
  • MAGIC_MAILBOX = 0xaaff0004 // Root of mail tree (nothing-abstract)
  • MAGIC_ATTACHMENT = 0xaaff0005 // Mail attachment
  • MAGIC_ANY = 0xaaff0006 // Trash folder type (accepts any object)
  • MAGIC_FILTER = 0xaaff0007 // Used to match messages against
  • MAGIC_FOLDER_2 = 0xaaff0008 // Folder v2
  • MAGIC_CONDITION = 0xaaff0009 // Filter condition
  • MAGIC_ACTION = 0xaaff0010 // Filter action
  • MAGIC_CALENDAR = 0xaaff0011 // Calendar event
  • MAGIC_ATTENDEE = 0xaaff0012 // Event attendee
  • MAGIC_GROUP = 0xaaff0013 // Group of contacts
  • MAGIC_MAX = 0xaaff0014 // One past the end
Object::Scribe Scribe The application.