MBS FileMaker Plugin Example Databases

Email Parser

All examples are included with download of MBS FileMaker Plugin.

Email Parser.fmp12

Overview
Tables4
Relationships3
Layouts4
Scripts1
Value Lists0
Custom Functions0
Custom Menus33
File Options
Default custom menu set[Standard FileMaker Menus]
When opening file
Minimum allowed version12.0
Login usingAccount Name; Account= Admin
Allow user to save passwordOff
Require iOS passcodeOff
Switch to layoutOff
Hide all toolbarsOff
Script triggers
OnFirstWindowOpenOff
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
Email Parser
6 fields defined, 1 record
Email Parser
Address
4 fields defined, 3 records
Address
Attachment
3 fields defined, 1 record
Attachment
InlineGraphics
3 fields defined, 0 record
InlineGraphics

Fields

Table Name: Email Parser - 6 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
InputNormal, TextAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Global
  • Repetitions: 1
  • Index Language: German
      SubjectNormal, TextAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
      • Indexing: None
      • Automatically create indexes as needed
      • Index Language: German
          PlainTextNormal, TextAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
              HTMLTextNormal, TextAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Repetitions: 1
              • Indexing: None
              • Automatically create indexes as needed
              • Index Language: German
                  MailerNormal, TextAuto-Enter:
                  • Allow editing
                  Validation:
                  • Only during data entry
                  Storage:
                  • Repetitions: 1
                  • Indexing: None
                  • Automatically create indexes as needed
                  • Index Language: German
                      EmailIDNormal, NumberAuto-Enter:
                      • Allow editing
                      • Do not replace existing value for field (if any)
                      • Context table: Email Parser
                        Calculation: Get ( RecordID )
                      Validation:
                      • Only during data entry
                      Storage:
                      • Repetitions: 1
                      • Indexing: All
                      • Index Language: German

                          Table Name: Address - 4 Fields
                          Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
                          TypeNormal, TextAuto-Enter:
                          • Allow editing
                          Validation:
                          • Only during data entry
                          Storage:
                          • Repetitions: 1
                          • Indexing: None
                          • Automatically create indexes as needed
                          • Index Language: German
                              NameNormal, TextAuto-Enter:
                              • Allow editing
                              Validation:
                              • Only during data entry
                              Storage:
                              • Repetitions: 1
                              • Indexing: None
                              • Automatically create indexes as needed
                              • Index Language: German
                                  EmailNormal, TextAuto-Enter:
                                  • Allow editing
                                  Validation:
                                  • Only during data entry
                                  Storage:
                                  • Repetitions: 1
                                  • Indexing: None
                                  • Automatically create indexes as needed
                                  • Index Language: German
                                      EmailIDNormal, NumberAuto-Enter:
                                      • Allow editing
                                      Validation:
                                      • Only during data entry
                                      Storage:
                                      • Repetitions: 1
                                      • Indexing: All
                                      • Index Language: German

                                          Table Name: Attachment - 3 Fields
                                          Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
                                          EmailIDNormal, NumberAuto-Enter:
                                          • Allow editing
                                          Validation:
                                          • Only during data entry
                                          Storage:
                                          • Repetitions: 1
                                          • Indexing: All
                                          • Index Language: German
                                            ContentNormal, BinaryAuto-Enter:
                                            • Allow editing
                                            Validation:
                                            • Only during data entry
                                            Storage:
                                            • Repetitions: 1
                                                FileNameNormal, TextAuto-Enter:
                                                • Allow editing
                                                Validation:
                                                • Only during data entry
                                                Storage:
                                                • Repetitions: 1
                                                • Indexing: None
                                                • Automatically create indexes as needed
                                                • Index Language: German

                                                    Table Name: InlineGraphics - 3 Fields
                                                    Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
                                                    EmailIDNormal, NumberAuto-Enter:
                                                    • Allow editing
                                                    Validation:
                                                    • Only during data entry
                                                    Storage:
                                                    • Repetitions: 1
                                                    • Indexing: All
                                                    • Index Language: German
                                                      ContentNormal, BinaryAuto-Enter:
                                                      • Allow editing
                                                      Validation:
                                                      • Only during data entry
                                                      Storage:
                                                      • Repetitions: 1
                                                          FileNameNormal, TextAuto-Enter:
                                                          • Allow editing
                                                          Validation:
                                                          • Only during data entry
                                                          Storage:
                                                          • Repetitions: 1
                                                          • Indexing: None
                                                          • Automatically create indexes as needed
                                                          • Index Language: German

                                                              Relationship: Email Parser=Address

                                                              Table OccurrenceEmail ParserAddress
                                                              FieldEmailID=EmailID
                                                              Source TableEmail ParserAddress
                                                              Source FileEmail Parser.fmp12Email Parser.fmp12
                                                              Allow creation of records via this relationshipOffOff
                                                              Delete related records in this table when a record is deleted in the other tableOffOff
                                                              Sort records

                                                              Off

                                                              Off

                                                              Relationship: Email Parser=InlineGraphics

                                                              Table OccurrenceEmail ParserInlineGraphics
                                                              FieldEmailID=EmailID
                                                              Source TableEmail ParserInlineGraphics
                                                              Source FileEmail Parser.fmp12Email Parser.fmp12
                                                              Allow creation of records via this relationshipOffOff
                                                              Delete related records in this table when a record is deleted in the other tableOffOff
                                                              Sort records

                                                              Off

                                                              Off

                                                              Layouts

                                                              Layout Hierarchy

                                                              Email Parser
                                                              Address
                                                              Attachment
                                                              InlineGraphics


                                                              Layout NameInclude In MenuQuick Find# of ObjectsShow Records FromSave record changes automaticallyShow field frames when record is activeShow field frames only on current recordShow current record indicator in List ViewUsed in ScriptsCustom Menu SetScript TriggersTheme ID
                                                              Email ParserYesYes Email ParserOnOnOffOn[File Default]01
                                                              AddressYesYes AddressOnOnOffOn [File Default]01
                                                              AttachmentYesYes AttachmentOnOnOffOn [File Default]01
                                                              InlineGraphicsYesYes InlineGraphicsOnOnOffOn [File Default]01

                                                              Layout Objects: Email Parser

                                                              Regular Fields

                                                              Field Name: Email Parser::Input
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 6 pt
                                                              • Left: 132 pt
                                                              • Bottom: 104 pt
                                                              • Right: 385 pt
                                                              • Anchoring: Left, Top
                                                              Field Format:
                                                              • Edit Box
                                                              Field Behavior:
                                                              • Allow field to be entered: In Find mode, In Browse mode
                                                              • Touch keyboard type: System Default
                                                              • Go to next field using: Tab key
                                                              No

                                                              Field Name: Email Parser::Subject
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 120 pt
                                                              • Left: 132 pt
                                                              • Bottom: 134 pt
                                                              • Right: 385 pt
                                                              • Anchoring: Left, Top
                                                              Field Format:
                                                              • Edit Box
                                                              Field Behavior:
                                                              • Allow field to be entered: In Find mode, In Browse mode
                                                              • Touch keyboard type: System Default
                                                              • Go to next field using: Tab key
                                                              Yes

                                                              Field Name: Email Parser::PlainText
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 162 pt
                                                              • Left: 132 pt
                                                              • Bottom: 308 pt
                                                              • Right: 481 pt
                                                              • Anchoring: Left, Top
                                                              Field Format:
                                                              • Edit Box
                                                              Field Behavior:
                                                              • Allow field to be entered: In Find mode, In Browse mode
                                                              • Touch keyboard type: System Default
                                                              • Go to next field using: Tab key
                                                              Yes

                                                              Field Name: Email Parser::HTMLText
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 162 pt
                                                              • Left: 486 pt
                                                              • Bottom: 308 pt
                                                              • Right: 835 pt
                                                              • Anchoring: Left, Top
                                                              Field Format:
                                                              • Edit Box
                                                              Field Behavior:
                                                              • Allow field to be entered: In Find mode, In Browse mode
                                                              • Touch keyboard type: System Default
                                                              • Go to next field using: Tab key
                                                              Yes

                                                              Field Name: Email Parser::Mailer
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 138 pt
                                                              • Left: 132 pt
                                                              • Bottom: 152 pt
                                                              • Right: 385 pt
                                                              • Anchoring: Left, Top
                                                              Field Format:
                                                              • Edit Box
                                                              Field Behavior:
                                                              • Allow field to be entered: In Find mode, In Browse mode
                                                              • Touch keyboard type: System Default
                                                              • Go to next field using: Tab key
                                                              Yes

                                                              Field Name: Address::Type
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 314 pt
                                                              • Left: 13 pt
                                                              • Bottom: 329 pt
                                                              • Right: 192 pt
                                                              • Anchoring: Left, Top
                                                              Field Format:
                                                              • Edit Box
                                                              Field Behavior:
                                                              • Allow field to be entered: In Find mode, In Browse mode
                                                              • Touch keyboard type: System Default
                                                              • Go to next field using: Tab key
                                                              Yes

                                                              Field Name: Address::Name
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 314 pt
                                                              • Left: 193 pt
                                                              • Bottom: 329 pt
                                                              • Right: 372 pt
                                                              • Anchoring: Left, Top
                                                              Field Format:
                                                              • Edit Box
                                                              Field Behavior:
                                                              • Allow field to be entered: In Find mode, In Browse mode
                                                              • Touch keyboard type: System Default
                                                              • Go to next field using: Tab key
                                                              Yes

                                                              Field Name: Address::Email
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 314 pt
                                                              • Left: 373 pt
                                                              • Bottom: 329 pt
                                                              • Right: 551 pt
                                                              • Anchoring: Left, Top
                                                              Field Format:
                                                              • Edit Box
                                                              Field Behavior:
                                                              • Allow field to be entered: In Find mode, In Browse mode
                                                              • Touch keyboard type: System Default
                                                              • Go to next field using: Tab key
                                                              Yes

                                                              Field Name: Attachment::Content
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 439 pt
                                                              • Left: 13 pt
                                                              • Bottom: 455 pt
                                                              • Right: 144 pt
                                                              • Anchoring: Left, Top
                                                              Field Format:
                                                              • Edit Box
                                                              Field Behavior:
                                                              • Allow field to be entered: In Find mode, In Browse mode
                                                              • Touch keyboard type: System Default
                                                              • Go to next field using: Tab key
                                                              No

                                                              Field Name: Attachment::FileName
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 439 pt
                                                              • Left: 145 pt
                                                              • Bottom: 455 pt
                                                              • Right: 275 pt
                                                              • Anchoring: Left, Top
                                                              Field Format:
                                                              • Edit Box
                                                              Field Behavior:
                                                              • Allow field to be entered: In Find mode, In Browse mode
                                                              • Touch keyboard type: System Default
                                                              • Go to next field using: Tab key
                                                              Yes

                                                              Field Name: InlineGraphics::Content
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 439 pt
                                                              • Left: 283 pt
                                                              • Bottom: 455 pt
                                                              • Right: 417 pt
                                                              • Anchoring: Left, Top
                                                              Field Format:
                                                              • Edit Box
                                                              Field Behavior:
                                                              • Allow field to be entered: In Find mode, In Browse mode
                                                              • Touch keyboard type: System Default
                                                              • Go to next field using: Tab key
                                                              No

                                                              Field Name: InlineGraphics::FileName
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 439 pt
                                                              • Left: 418 pt
                                                              • Bottom: 455 pt
                                                              • Right: 551 pt
                                                              • Anchoring: Left, Top
                                                              Field Format:
                                                              • Edit Box
                                                              Field Behavior:
                                                              • Allow field to be entered: In Find mode, In Browse mode
                                                              • Touch keyboard type: System Default
                                                              • Go to next field using: Tab key
                                                              Yes

                                                              Field Name: Email Parser::EmailID
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 120 pt
                                                              • Left: 780 pt
                                                              • Bottom: 134 pt
                                                              • Right: 835 pt
                                                              • Anchoring: Left, Top
                                                              Field Format:
                                                              • Edit Box
                                                              Field Behavior:
                                                              • Allow field to be entered: In Find mode, In Browse mode
                                                              • Touch keyboard type: System Default
                                                              • Go to next field using: Tab key
                                                              Yes

                                                              Group Buttons

                                                              Button PropertiesCoordinatesScript/Script Step
                                                                Type:
                                                              • Text: Parse Email
                                                                Additional Properties:
                                                              • Change to hand cursor over button
                                                              • Rectangular
                                                              • Top: 78 pt
                                                              • Left: 402 pt
                                                              • Bottom: 103 pt
                                                              • Right: 529 pt
                                                              • Anchoring: Left, Top
                                                              Perform Script [ “ParseEmail” ]

                                                              Scripts:


                                                              Portals

                                                              Portal PropertiesCoordinatesFieldsOptions
                                                              • Top: 312 pt
                                                              • Left: 12 pt
                                                              • Bottom: 433 pt
                                                              • Right: 553 pt
                                                              • Anchoring: Left, Top
                                                              Field Objects
                                                              • Sort records: Off
                                                              • Filter calculation: None
                                                              • Initial Row: 1
                                                              • Number of Rows: 7

                                                              Portal PropertiesCoordinatesFieldsOptions
                                                              • Top: 438 pt
                                                              • Left: 12 pt
                                                              • Bottom: 565 pt
                                                              • Right: 277 pt
                                                              • Anchoring: Left, Top
                                                              Field Objects
                                                              • Sort records: Off
                                                              • Filter calculation: None
                                                              • Initial Row: 1
                                                              • Number of Rows: 7

                                                              Portal PropertiesCoordinatesFieldsOptions
                                                              • Top: 438 pt
                                                              • Left: 282 pt
                                                              • Bottom: 565 pt
                                                              • Right: 553 pt
                                                              • Anchoring: Left, Top
                                                              Field Objects
                                                              • Sort records: Off
                                                              • Filter calculation: None
                                                              • Initial Row: 1
                                                              • Number of Rows: 7

                                                              Layout Objects: Address

                                                              Regular Fields

                                                              Field Name: Address::Type
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 24 pt
                                                              • Left: 138 pt
                                                              • Bottom: 38 pt
                                                              • Right: 391 pt
                                                              • Anchoring: Left, Top
                                                              Field Format:
                                                              • Edit Box
                                                              Field Behavior:
                                                              • Allow field to be entered: In Find mode, In Browse mode
                                                              • Touch keyboard type: System Default
                                                              • Go to next field using: Tab key
                                                              Yes

                                                              Field Name: Address::Name
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 42 pt
                                                              • Left: 138 pt
                                                              • Bottom: 56 pt
                                                              • Right: 391 pt
                                                              • Anchoring: Left, Top
                                                              Field Format:
                                                              • Edit Box
                                                              Field Behavior:
                                                              • Allow field to be entered: In Find mode, In Browse mode
                                                              • Touch keyboard type: System Default
                                                              • Go to next field using: Tab key
                                                              Yes

                                                              Field Name: Address::Email
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 60 pt
                                                              • Left: 138 pt
                                                              • Bottom: 74 pt
                                                              • Right: 391 pt
                                                              • Anchoring: Left, Top
                                                              Field Format:
                                                              • Edit Box
                                                              Field Behavior:
                                                              • Allow field to be entered: In Find mode, In Browse mode
                                                              • Touch keyboard type: System Default
                                                              • Go to next field using: Tab key
                                                              Yes

                                                              Layout Objects: Attachment

                                                              Regular Fields

                                                              Field Name: Attachment::EmailID
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 24 pt
                                                              • Left: 138 pt
                                                              • Bottom: 38 pt
                                                              • Right: 217 pt
                                                              • Anchoring: Left, Top
                                                              Field Format:
                                                              • Edit Box
                                                              Field Behavior:
                                                              • Allow field to be entered: In Find mode, In Browse mode
                                                              • Touch keyboard type: System Default
                                                              • Go to next field using: Tab key
                                                              Yes

                                                              Field Name: Attachment::Content
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 42 pt
                                                              • Left: 138 pt
                                                              • Bottom: 167 pt
                                                              • Right: 391 pt
                                                              • Anchoring: Left, Top
                                                              Field Format:
                                                              • Edit Box
                                                              Field Behavior:
                                                              • Allow field to be entered: In Find mode, In Browse mode
                                                              • Touch keyboard type: System Default
                                                              • Go to next field using: Tab key
                                                              No

                                                              Field Name: Attachment::FileName
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 168 pt
                                                              • Left: 138 pt
                                                              • Bottom: 182 pt
                                                              • Right: 391 pt
                                                              • Anchoring: Left, Top
                                                              Field Format:
                                                              • Edit Box
                                                              Field Behavior:
                                                              • Allow field to be entered: In Find mode, In Browse mode
                                                              • Touch keyboard type: System Default
                                                              • Go to next field using: Tab key
                                                              Yes

                                                              Layout Objects: InlineGraphics

                                                              Regular Fields

                                                              Field Name: InlineGraphics::EmailID
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 24 pt
                                                              • Left: 138 pt
                                                              • Bottom: 38 pt
                                                              • Right: 217 pt
                                                              • Anchoring: Left, Top
                                                              Field Format:
                                                              • Edit Box
                                                              Field Behavior:
                                                              • Allow field to be entered: In Find mode, In Browse mode
                                                              • Touch keyboard type: System Default
                                                              • Go to next field using: Tab key
                                                              Yes

                                                              Field Name: InlineGraphics::Content
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 42 pt
                                                              • Left: 138 pt
                                                              • Bottom: 167 pt
                                                              • Right: 391 pt
                                                              • Anchoring: Left, Top
                                                              Field Format:
                                                              • Edit Box
                                                              Field Behavior:
                                                              • Allow field to be entered: In Find mode, In Browse mode
                                                              • Touch keyboard type: System Default
                                                              • Go to next field using: Tab key
                                                              No

                                                              Field Name: InlineGraphics::FileName
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 168 pt
                                                              • Left: 138 pt
                                                              • Bottom: 182 pt
                                                              • Right: 391 pt
                                                              • Anchoring: Left, Top
                                                              Field Format:
                                                              • Edit Box
                                                              Field Behavior:
                                                              • Allow field to be entered: In Find mode, In Browse mode
                                                              • Touch keyboard type: System Default
                                                              • Go to next field using: Tab key
                                                              Yes

                                                              Script Hierarchy

                                                              ParseEmail

                                                              Script NameParseEmail
                                                              Run script with full access privilegesOff
                                                              Include In MenuYes
                                                              Layouts that use this script
                                                              Scripts that use this script
                                                                Script Definition
                                                                Script Steps
                                                                • Set Variable [ $email; Value:MBS("EmailParser.Parse"; Email Parser::Input) ]
                                                                • If [ MBS("IsError") = 1 ]
                                                                • Show Custom Dialog [ Title: "Failed to parse email."; Message: Middle($email; 7; Length($email)); Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                                                                • Exit Script [ ]
                                                                • End If
                                                                • #Show text:
                                                                • Set Field [ Email Parser::Subject; MBS("EmailParser.Subject"; $email) ]
                                                                • Set Field [ Email Parser::PlainText; MBS("EmailParser.plainText"; $email) ]
                                                                • Set Field [ Email Parser::HTMLText; MBS("EmailParser.HTMLText"; $email) ]
                                                                • #find all addresses
                                                                • Set Variable [ $EmailRecordID; Value:Get(RecordID) ]
                                                                • Set Variable [ $i; Value:0 ]
                                                                • Set Variable [ $c; Value:MBS("EmailParser.AddressCount"; $email) ]
                                                                • If [ $c > 0 ]
                                                                • Go to Related Record [ From table: “Address”; Using layout: “Address” (Address) ] [ Show only related records ]
                                                                • Go to Layout [ “Address” (Address) ]
                                                                • Delete All Records [ No dialog ]
                                                                • Loop
                                                                • Set Variable [ $Name; Value:MBS("EmailParser.Address"; $email; $i; "name") ]
                                                                • Set Variable [ $emailAddress; Value:MBS("EmailParser.Address"; $email; $i; "email") ]
                                                                • Set Variable [ $type; Value:MBS("EmailParser.Address"; $email; $i; "type") ]
                                                                • New Record/Request
                                                                • Set Field [ Address::Type; $type ]
                                                                • Set Field [ Address::Email; $emailAddress ]
                                                                • Set Field [ Address::Name; $name ]
                                                                • Set Field [ Address::EmailID; $EmailRecordID ]
                                                                • Commit Records/Requests [ Skip data entry validation; No dialog ]
                                                                • #next
                                                                • Set Variable [ $i; Value:$i + 1 ]
                                                                • Exit Loop If [ $i = $c ]
                                                                • End Loop
                                                                • End If
                                                                • #find all attachments
                                                                • Set Variable [ $i; Value:0 ]
                                                                • Set Variable [ $c; Value:MBS("EmailParser.AttachmentCount"; $email) ]
                                                                • If [ $c > 0 ]
                                                                • Go to Related Record [ From table: “Attachment”; Using layout: “Attachment” (Attachment) ] [ Show only related records ]
                                                                • Go to Layout [ “Attachment” (Attachment) ]
                                                                • Delete All Records [ No dialog ]
                                                                • Loop
                                                                • Set Variable [ $Name; Value:MBS("EmailParser.attachment"; $email; $i; "filename") ]
                                                                • Set Variable [ $content; Value:MBS("EmailParser.attachment"; $email; $i; "container") ]
                                                                • New Record/Request
                                                                • Set Field [ Attachment::Content; $content ]
                                                                • Set Field [ Attachment::FileName; $name ]
                                                                • Set Field [ Attachment::EmailID; $EmailRecordID ]
                                                                • Commit Records/Requests [ Skip data entry validation; No dialog ]
                                                                • #next
                                                                • Set Variable [ $i; Value:$i + 1 ]
                                                                • Exit Loop If [ $i = $c ]
                                                                • End Loop
                                                                • End If
                                                                • #find all inline graphics
                                                                • Set Variable [ $i; Value:0 ]
                                                                • Set Variable [ $c; Value:MBS("EmailParser.InlineCount"; $email) ]
                                                                • If [ $c > 0 ]
                                                                • Go to Related Record [ From table: “InlineGraphics”; Using layout: “InlineGraphics” (InlineGraphics) ] [ Show only related records ]
                                                                • Go to Layout [ “InlineGraphics” (InlineGraphics) ]
                                                                • Delete All Records [ No dialog ]
                                                                • Loop
                                                                • Set Variable [ $Name; Value:MBS("EmailParser.inline"; $email; $i; "filename") ]
                                                                • Set Variable [ $content; Value:MBS("EmailParser.Inline"; $email; $i; "container") ]
                                                                • New Record/Request
                                                                • Set Field [ InlineGraphics::Content; $content ]
                                                                • Set Field [ InlineGraphics::FileName; $name ]
                                                                • Set Field [ InlineGraphics::EmailID; $EmailRecordID ]
                                                                • Commit Records/Requests [ Skip data entry validation; No dialog ]
                                                                • #next
                                                                • Set Variable [ $i; Value:$i + 1 ]
                                                                • Exit Loop If [ $i = $c ]
                                                                • End Loop
                                                                • End If
                                                                • Go to Layout [ original layout ]
                                                                • #find a header
                                                                • Set Variable [ $i; Value:0 ]
                                                                • Set Variable [ $c; Value:MBS("EmailParser.HeaderCount"; $email) ]
                                                                • If [ $c > 0 ]
                                                                • Loop
                                                                • Set Variable [ $HeaderName; Value:MBS("EmailParser.Header"; $email; $i; "name") ]
                                                                • If [ $HeaderName = "X-Mailer" ]
                                                                • Set Variable [ $HeaderValue; Value:MBS("EmailParser.Header"; $email; $i; "value") ]
                                                                • Set Field [ Email Parser::Mailer; $HeaderValue ]
                                                                • End If
                                                                • #next
                                                                • Set Variable [ $i; Value:$i + 1 ]
                                                                • Exit Loop If [ $i = $c ]
                                                                • End Loop
                                                                • End If
                                                                • #cleanup
                                                                • Set Variable [ $r; Value:MBS("EmailParser.Free"; $email) ]
                                                                Fields used in this script
                                                                Scripts used in this script
                                                                  Layouts used in this script
                                                                  Tables used in this script
                                                                  Table occurrences used by this script
                                                                  Custom Functions used by this script
                                                                    Custom menu set used by this script

                                                                      Download example: Email Parser

                                                                      Used functions:




                                                                      Links
                                                                      MBS FileMaker tutorial videos