Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

MBS FileMaker Plugin Example Databases

Belgian EID Reader

All examples are included with download of MBS FileMaker Plugin.

Belgian EID Reader.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts13
Value Lists0
Custom Functions0
Custom Menus24
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
OnFirstWindowOpenScript: [OnFirstWindowOpen]
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
Belgian EID Reader
21 fields defined, 0 record
Belgian EID Reader

Fields

Table Name: Belgian EID Reader - 21 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
cardNumberNormal, TextAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
  • Indexing: None
  • Automatically create indexes as needed
  • Index Language: English
      cardChipNumberNormal, TextAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
      • Indexing: None
      • Automatically create indexes as needed
      • Index Language: English
          cardValidityStartNormal, TextAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: English
              cardValidityStopNormal, TextAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Repetitions: 1
              • Indexing: None
              • Automatically create indexes as needed
              • Index Language: English
                  cardDeliveryMunicipalityNormal, TextAuto-Enter:
                  • Allow editing
                  Validation:
                  • Only during data entry
                  Storage:
                  • Repetitions: 1
                  • Indexing: None
                  • Automatically create indexes as needed
                  • Index Language: English
                      nationalNumberNormal, TextAuto-Enter:
                      • Allow editing
                      Validation:
                      • Only during data entry
                      Storage:
                      • Repetitions: 1
                      • Indexing: None
                      • Automatically create indexes as needed
                      • Index Language: English
                          nameLastNormal, TextAuto-Enter:
                          • Allow editing
                          Validation:
                          • Only during data entry
                          Storage:
                          • Repetitions: 1
                          • Indexing: None
                          • Automatically create indexes as needed
                          • Index Language: English
                              namesFirstAndSecondNormal, TextAuto-Enter:
                              • Allow editing
                              Validation:
                              • Only during data entry
                              Storage:
                              • Repetitions: 1
                              • Indexing: None
                              • Automatically create indexes as needed
                              • Index Language: English
                                  nameThirdFirstLetterNormal, TextAuto-Enter:
                                  • Allow editing
                                  Validation:
                                  • Only during data entry
                                  Storage:
                                  • Repetitions: 1
                                  • Indexing: None
                                  • Automatically create indexes as needed
                                  • Index Language: English
                                      nationalityNormal, TextAuto-Enter:
                                      • Allow editing
                                      Validation:
                                      • Only during data entry
                                      Storage:
                                      • Repetitions: 1
                                      • Indexing: None
                                      • Automatically create indexes as needed
                                      • Index Language: English
                                          birthLocationNormal, TextAuto-Enter:
                                          • Allow editing
                                          Validation:
                                          • Only during data entry
                                          Storage:
                                          • Repetitions: 1
                                          • Indexing: None
                                          • Automatically create indexes as needed
                                          • Index Language: English
                                              birthDateAsStringNormal, TextAuto-Enter:
                                              • Allow editing
                                              Validation:
                                              • Only during data entry
                                              Storage:
                                              • Repetitions: 1
                                              • Indexing: None
                                              • Automatically create indexes as needed
                                              • Index Language: English
                                                  genderNormal, TextAuto-Enter:
                                                  • Allow editing
                                                  Validation:
                                                  • Only during data entry
                                                  Storage:
                                                  • Repetitions: 1
                                                  • Indexing: None
                                                  • Automatically create indexes as needed
                                                  • Index Language: English
                                                      nobleConditionNormal, TextAuto-Enter:
                                                      • Allow editing
                                                      Validation:
                                                      • Only during data entry
                                                      Storage:
                                                      • Repetitions: 1
                                                      • Indexing: None
                                                      • Automatically create indexes as needed
                                                      • Index Language: English
                                                          documentTypeNormal, TextAuto-Enter:
                                                          • Allow editing
                                                          Validation:
                                                          • Only during data entry
                                                          Storage:
                                                          • Repetitions: 1
                                                          • Indexing: None
                                                          • Automatically create indexes as needed
                                                          • Index Language: English
                                                              specialStatusNormal, TextAuto-Enter:
                                                              • Allow editing
                                                              Validation:
                                                              • Only during data entry
                                                              Storage:
                                                              • Repetitions: 1
                                                              • Indexing: None
                                                              • Automatically create indexes as needed
                                                              • Index Language: English
                                                                  photoNormal, BinaryAuto-Enter:
                                                                  • Allow editing
                                                                  Validation:
                                                                  • Only during data entry
                                                                  Storage:
                                                                  • Repetitions: 1
                                                                      residenceStreetAndNrNormal, TextAuto-Enter:
                                                                      • Allow editing
                                                                      Validation:
                                                                      • Only during data entry
                                                                      Storage:
                                                                      • Repetitions: 1
                                                                      • Indexing: None
                                                                      • Automatically create indexes as needed
                                                                      • Index Language: English
                                                                          residencePostalCodeNormal, TextAuto-Enter:
                                                                          • Allow editing
                                                                          Validation:
                                                                          • Only during data entry
                                                                          Storage:
                                                                          • Repetitions: 1
                                                                          • Indexing: None
                                                                          • Automatically create indexes as needed
                                                                          • Index Language: English
                                                                              residenceMunicipalityNormal, TextAuto-Enter:
                                                                              • Allow editing
                                                                              Validation:
                                                                              • Only during data entry
                                                                              Storage:
                                                                              • Repetitions: 1
                                                                              • Indexing: None
                                                                              • Automatically create indexes as needed
                                                                              • Index Language: English
                                                                                  versionCalculated, DateCalculation: Storage:
                                                                                  • Repetitions: 1
                                                                                  • Indexing: None
                                                                                  • Automatically create indexes as needed
                                                                                  • Index Language: English

                                                                                          Layout Objects: Belgian EID Reader

                                                                                          Regular Fields

                                                                                          Field Name: Belgian EID Reader::photo
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 215 pt
                                                                                          • Left: 104 pt
                                                                                          • Bottom: 415 pt
                                                                                          • Right: 244 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Touch keyboard type: Default for Data Type
                                                                                          • Go to next field using: Tab key
                                                                                          No

                                                                                          Field Name: Belgian EID Reader::cardNumber
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 16 pt
                                                                                          • Left: 879 pt
                                                                                          • Bottom: 37 pt
                                                                                          • Right: 1132 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: Default for Data Type
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Belgian EID Reader::cardChipNumber
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 41 pt
                                                                                          • Left: 879 pt
                                                                                          • Bottom: 62 pt
                                                                                          • Right: 1132 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: Default for Data Type
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Belgian EID Reader::cardValidityStart
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 66 pt
                                                                                          • Left: 879 pt
                                                                                          • Bottom: 87 pt
                                                                                          • Right: 1132 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: Default for Data Type
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Belgian EID Reader::cardValidityStop
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 91 pt
                                                                                          • Left: 879 pt
                                                                                          • Bottom: 112 pt
                                                                                          • Right: 1132 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: Default for Data Type
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Belgian EID Reader::cardDeliveryMunicipality
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 116 pt
                                                                                          • Left: 879 pt
                                                                                          • Bottom: 137 pt
                                                                                          • Right: 1132 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: Default for Data Type
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Belgian EID Reader::nationalNumber
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 141 pt
                                                                                          • Left: 879 pt
                                                                                          • Bottom: 162 pt
                                                                                          • Right: 1132 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: Default for Data Type
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Belgian EID Reader::nameLast
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 166 pt
                                                                                          • Left: 879 pt
                                                                                          • Bottom: 187 pt
                                                                                          • Right: 1132 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: Default for Data Type
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Belgian EID Reader::namesFirstAndSecond
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 191 pt
                                                                                          • Left: 879 pt
                                                                                          • Bottom: 212 pt
                                                                                          • Right: 1132 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: Default for Data Type
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Belgian EID Reader::nameThirdFirstLetter
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 216 pt
                                                                                          • Left: 879 pt
                                                                                          • Bottom: 237 pt
                                                                                          • Right: 1132 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: Default for Data Type
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Belgian EID Reader::nationality
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 241 pt
                                                                                          • Left: 879 pt
                                                                                          • Bottom: 262 pt
                                                                                          • Right: 1132 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: Default for Data Type
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Belgian EID Reader::birthLocation
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 266 pt
                                                                                          • Left: 879 pt
                                                                                          • Bottom: 287 pt
                                                                                          • Right: 1132 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: Default for Data Type
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Belgian EID Reader::birthDateAsString
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 291 pt
                                                                                          • Left: 879 pt
                                                                                          • Bottom: 312 pt
                                                                                          • Right: 1132 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: Default for Data Type
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Belgian EID Reader::gender
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 316 pt
                                                                                          • Left: 879 pt
                                                                                          • Bottom: 337 pt
                                                                                          • Right: 1132 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: Default for Data Type
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Belgian EID Reader::nobleCondition
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 341 pt
                                                                                          • Left: 879 pt
                                                                                          • Bottom: 362 pt
                                                                                          • Right: 1132 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: Default for Data Type
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Belgian EID Reader::documentType
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 366 pt
                                                                                          • Left: 879 pt
                                                                                          • Bottom: 387 pt
                                                                                          • Right: 1132 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: Default for Data Type
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Belgian EID Reader::specialStatus
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 391 pt
                                                                                          • Left: 879 pt
                                                                                          • Bottom: 412 pt
                                                                                          • Right: 1132 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: Default for Data Type
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Belgian EID Reader::residenceStreetAndNr
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 416 pt
                                                                                          • Left: 879 pt
                                                                                          • Bottom: 437 pt
                                                                                          • Right: 1132 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: Default for Data Type
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Belgian EID Reader::residencePostalCode
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 441 pt
                                                                                          • Left: 879 pt
                                                                                          • Bottom: 462 pt
                                                                                          • Right: 1132 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: Default for Data Type
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Belgian EID Reader::residenceMunicipality
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 466 pt
                                                                                          • Left: 879 pt
                                                                                          • Bottom: 487 pt
                                                                                          • Right: 1132 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: Default for Data Type
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Merge Fields

                                                                                          Field PropertiesCoordinatesFieldsQuick Find
                                                                                            Text:
                                                                                          • <<nameLast>>
                                                                                          • Top: 180 pt
                                                                                          • Left: 450 pt
                                                                                          • Bottom: 197 pt
                                                                                          • Right: 688 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Yes

                                                                                          Field PropertiesCoordinatesFieldsQuick Find
                                                                                            Text:
                                                                                          • <<namesFirstAndSecond>> <<nameThirdFirstLetter>>
                                                                                          • Top: 206 pt
                                                                                          • Left: 450 pt
                                                                                          • Bottom: 236 pt
                                                                                          • Right: 688 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Yes

                                                                                          Field PropertiesCoordinatesFieldsQuick Find
                                                                                            Text:
                                                                                          • <<birthLocation>>
                                                                                          • Top: 230 pt
                                                                                          • Left: 450 pt
                                                                                          • Bottom: 247 pt
                                                                                          • Right: 688 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Yes

                                                                                          Field PropertiesCoordinatesFieldsQuick Find
                                                                                            Text:
                                                                                          • <<birthDateAsString>>
                                                                                          • Top: 256 pt
                                                                                          • Left: 450 pt
                                                                                          • Bottom: 273 pt
                                                                                          • Right: 688 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Yes

                                                                                          Field PropertiesCoordinatesFieldsQuick Find
                                                                                            Text:
                                                                                          • <<gender>>
                                                                                          • Top: 280 pt
                                                                                          • Left: 450 pt
                                                                                          • Bottom: 297 pt
                                                                                          • Right: 688 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Yes

                                                                                          Field PropertiesCoordinatesFieldsQuick Find
                                                                                            Text:
                                                                                          • <<nationalNumber>>
                                                                                          • Top: 305 pt
                                                                                          • Left: 450 pt
                                                                                          • Bottom: 322 pt
                                                                                          • Right: 688 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Yes

                                                                                          Field PropertiesCoordinatesFieldsQuick Find
                                                                                            Text:
                                                                                          • <<nationality>>
                                                                                          • Top: 330 pt
                                                                                          • Left: 450 pt
                                                                                          • Bottom: 347 pt
                                                                                          • Right: 688 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Yes

                                                                                          Field PropertiesCoordinatesFieldsQuick Find
                                                                                            Text:
                                                                                          • <<nobleCondition>>
                                                                                          • Top: 355 pt
                                                                                          • Left: 450 pt
                                                                                          • Bottom: 372 pt
                                                                                          • Right: 688 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Yes

                                                                                          Field PropertiesCoordinatesFieldsQuick Find
                                                                                            Text:
                                                                                          • <<specialStatus>>
                                                                                          • Top: 379 pt
                                                                                          • Left: 450 pt
                                                                                          • Bottom: 396 pt
                                                                                          • Right: 688 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Yes

                                                                                          Field PropertiesCoordinatesFieldsQuick Find
                                                                                            Text:
                                                                                          • <<residenceStreetAndNr>>
                                                                                          • Top: 414 pt
                                                                                          • Left: 450 pt
                                                                                          • Bottom: 431 pt
                                                                                          • Right: 688 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Yes

                                                                                          Field PropertiesCoordinatesFieldsQuick Find
                                                                                            Text:
                                                                                          • <<residencePostalCode>>
                                                                                          • Top: 438 pt
                                                                                          • Left: 450 pt
                                                                                          • Bottom: 455 pt
                                                                                          • Right: 688 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Yes

                                                                                          Field PropertiesCoordinatesFieldsQuick Find
                                                                                            Text:
                                                                                          • <<residenceMunicipality>>
                                                                                          • Top: 464 pt
                                                                                          • Left: 450 pt
                                                                                          • Bottom: 481 pt
                                                                                          • Right: 688 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Yes

                                                                                          Field PropertiesCoordinatesFieldsQuick Find
                                                                                            Text:
                                                                                          • <<cardNumber>>
                                                                                          • Top: 180 pt
                                                                                          • Left: 365 pt
                                                                                          • Bottom: 197 pt
                                                                                          • Right: 603 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Yes

                                                                                          Field PropertiesCoordinatesFieldsQuick Find
                                                                                            Text:
                                                                                          • <<cardDeliveryMunicipality>>
                                                                                          • Top: 206 pt
                                                                                          • Left: 365 pt
                                                                                          • Bottom: 223 pt
                                                                                          • Right: 603 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Yes

                                                                                          Field PropertiesCoordinatesFieldsQuick Find
                                                                                            Text:
                                                                                          • <<cardChipNumber>>
                                                                                          • Top: 230 pt
                                                                                          • Left: 365 pt
                                                                                          • Bottom: 247 pt
                                                                                          • Right: 603 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Yes

                                                                                          Field PropertiesCoordinatesFieldsQuick Find
                                                                                            Text:
                                                                                          • <<cardValidityStart>>
                                                                                          • Top: 256 pt
                                                                                          • Left: 365 pt
                                                                                          • Bottom: 273 pt
                                                                                          • Right: 603 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Yes

                                                                                          Field PropertiesCoordinatesFieldsQuick Find
                                                                                            Text:
                                                                                          • <<cardValidityStop>>
                                                                                          • Top: 280 pt
                                                                                          • Left: 365 pt
                                                                                          • Bottom: 297 pt
                                                                                          • Right: 603 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Yes

                                                                                          Button Bars

                                                                                          Button Bar PropertiesCoordinates
                                                                                            Orientation:
                                                                                          • horizontal
                                                                                          • Top: 54 pt
                                                                                          • Left: 288 pt
                                                                                          • Bottom: 105 pt
                                                                                          • Right: 428 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Button Segments
                                                                                          Button PropertiesCoordinatesScript/Script Step
                                                                                            Type:
                                                                                          • Text:
                                                                                            Label Calculations:
                                                                                          • "Read Card"
                                                                                          • Top: 55 pt
                                                                                          • Left: 289 pt
                                                                                          • Bottom: 104 pt
                                                                                          • Right: 427 pt
                                                                                          Perform Script [ “[button] read eid card” ]

                                                                                          Scripts:


                                                                                          Tab Controls

                                                                                          Tab Control PropertiesCoordinates
                                                                                            Justification:
                                                                                          • Center
                                                                                            Tab Width:
                                                                                            Default Front Tab:
                                                                                          • Tab 0
                                                                                          • Top: 5 pt
                                                                                          • Left: 5 pt
                                                                                          • Bottom: 605 pt
                                                                                          • Right: 705 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Tabs
                                                                                          Tab PropertiesTab ControlsSlide ControlsFieldsButtonsPortalsWeb Viewer ControlsCharts
                                                                                            Tab 0:
                                                                                          • "Identity"
                                                                                              Field ObjectsMerge Field Objects
                                                                                                Tab 1:
                                                                                              • "Card"
                                                                                                  Merge Field Objects

                                                                                                  Script Hierarchy

                                                                                                  [OnFirstWindowOpen]
                                                                                                  [button] read eid card
                                                                                                  [button] sign document
                                                                                                  subscripts
                                                                                                  [sub] init text strings
                                                                                                  [sub] init SmartCard lib
                                                                                                  [sub] select reader
                                                                                                  [sub] connect card
                                                                                                  [sub] read eid card
                                                                                                  [sub] lower level photo read
                                                                                                  [sub] sign document (not OK yet)
                                                                                                  [sub] analyse card contents
                                                                                                  Read me for more information
                                                                                                  visit https://www.clarify.net

                                                                                                  Next Script: [[button] read eid card]
                                                                                                  Script Name[OnFirstWindowOpen]
                                                                                                  Run script with full access privilegesOff
                                                                                                  Include In MenuNo
                                                                                                  Layouts that use this script
                                                                                                    Scripts that use this script
                                                                                                      Script Definition
                                                                                                      Script Steps
                                                                                                      • #============================================================================================================
                                                                                                      • #Purpose: startup script
                                                                                                      • #Parameters: none
                                                                                                      • #Called From: [OnFirstWindowOpen] event
                                                                                                      • #Author: Peter Wagemans - Clarify
                                                                                                      • #Notes: none
                                                                                                      • #Revision: 2019/11/11: initial
                                                                                                      • #============================================================================================================
                                                                                                      • Adjust Window [ Resize to Fit ]
                                                                                                      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

                                                                                                                    Previous Script: [[OnFirstWindowOpen]]Next Script: [[button] sign document]
                                                                                                                    Script Name[button] read eid card
                                                                                                                    Run script with full access privilegesOff
                                                                                                                    Include In MenuNo
                                                                                                                    Layouts that use this script
                                                                                                                    Scripts that use this script
                                                                                                                      Script Definition
                                                                                                                      Script Steps
                                                                                                                      • #============================================================================================================
                                                                                                                      • #Purpose: interface script tries to read an inserted Belgian EID card
                                                                                                                      • #Parameters: none
                                                                                                                      • #Called From: button on layout
                                                                                                                      • #Author: Peter Wagemans - Clarify
                                                                                                                      • #Notes: none
                                                                                                                      • #Revision: 2019/11/11: initial
                                                                                                                      • #============================================================================================================
                                                                                                                      • #initialize text strings if not done yet
                                                                                                                      • If [ not MBS( "FM.VariableExists"; "smartcard.stringsInitialised" ) ]
                                                                                                                      • Perform Script [ “[sub] init text strings” ]
                                                                                                                      • End If
                                                                                                                      • #use this icon for progress dialog and possible error dialog
                                                                                                                      • Insert Text [ $icon ]
                                                                                                                      • #show a progress dialog
                                                                                                                      • Set Variable [ $r; Value:MBS( "ProgressDialog.Reset" ) ]
                                                                                                                      • Set Variable [ $r; Value:MBS("ProgressDialog.SetProgress"; -1) ]
                                                                                                                      • Set Variable [ $r; Value:MBS( "ProgressDialog.SetShowButton"; False ) ]
                                                                                                                      • Set Variable [ $r; Value:MBS( "ProgressDialog.SetImage"; MBS( "Container.DecodeFromBase64"; "PNG" ; $icon ) ) ]
                                                                                                                      • Set Variable [ $r; Value:MBS("ProgressDialog.SetTopText"; MBS( "FM.VariableGet"; "smartcard.ProgressDialog.TopText" ) ) ]
                                                                                                                      • Set Variable [ $r; Value:MBS("ProgressDialog.Show") ]
                                                                                                                      • Pause/Resume Script [ Duration (seconds): 1/10 // just to get it to show ]
                                                                                                                      • #try to read the card and return error when error occurred
                                                                                                                      • Perform Script [ “[sub] read eid card” ]
                                                                                                                      • #read error entry in json result and show dialog if error not 0
                                                                                                                      • Set Variable [ $json; Value:Get ( ScriptResult ) ]
                                                                                                                      • If [ JSONGetElement ( $json ; "error" ) ≠ 0 ]
                                                                                                                      • Set Variable [ $r; Value:MBS("ProgressDialog.Hide") ]
                                                                                                                      • Set Variable [ $r; Value:MBS("Dialog.Reset") ]
                                                                                                                      • Set Variable [ $r; Value:MBS("Dialog.SetMessage"; JSONGetElement ( $json ; "errorMessage" ) ) ]
                                                                                                                      • If [ not IsEmpty ( JSONGetElement ( $json ; "errorMBS" ) ) ]
                                                                                                                      • Set Variable [ $r; Value:MBS("Dialog.SetInformativeText"; "MBS Error: " & JSONGetElement ( $json ; "errorMBS" ) ) ]
                                                                                                                      • End If
                                                                                                                      • Set Variable [ $r; Value:MBS("Dialog.SetDefaultButton"; "OK" ) ]
                                                                                                                      • Set Variable [ $r; Value:MBS("Dialog.SetIcon"; MBS( "Container.DecodeFromBase64"; "PNG" ; $icon ) ) ]
                                                                                                                      • Set Variable [ $r; Value:MBS("Dialog.SetMode"; "Error" ) ]
                                                                                                                      • Set Variable [ $r; Value:MBS("Dialog.Run") ]
                                                                                                                      • Exit Script [ ]
                                                                                                                      • End If
                                                                                                                      • #this is just for convenience and can be removed
                                                                                                                      • If [ not IsEmpty ( Belgian EID Reader::cardNumber ) or Get ( FoundCount ) = 0 ]
                                                                                                                      • New Record/Request
                                                                                                                      • End If
                                                                                                                      • #the result is returned as a JSON array of data, we fill in the fields with that array
                                                                                                                      • Set Field [ Belgian EID Reader::cardNumber; JSONGetElement ( $json ; "cardNumber" ) ]
                                                                                                                      • Set Field [ Belgian EID Reader::cardChipNumber; HexEncode ( JSONGetElement ( $json ; "cardChipNumber" ) ) ]
                                                                                                                      • Set Field [ Belgian EID Reader::cardValidityStart; JSONGetElement ( $json ; "cardValidityStart" ) ]
                                                                                                                      • Set Field [ Belgian EID Reader::cardValidityStop; JSONGetElement ( $json ; "cardValidityStop" ) ]
                                                                                                                      • Set Field [ Belgian EID Reader::cardDeliveryMunicipality; JSONGetElement ( $json ; "cardDeliveryMunicipality" ) ]
                                                                                                                      • Set Field [ Belgian EID Reader::nationalNumber; JSONGetElement ( $json ; "nationalNumber" ) ]
                                                                                                                      • Set Field [ Belgian EID Reader::nameLast; JSONGetElement ( $json ; "nameLast" ) ]
                                                                                                                      • Set Field [ Belgian EID Reader::namesFirstAndSecond; JSONGetElement ( $json ; "namesFirstAndSecond" ) ]
                                                                                                                      • Set Field [ Belgian EID Reader::nameThirdFirstLetter; JSONGetElement ( $json ; "nameThirdFirstLetter" ) ]
                                                                                                                      • Set Field [ Belgian EID Reader::nationality; JSONGetElement ( $json ; "nationality" ) ]
                                                                                                                      • Set Field [ Belgian EID Reader::birthLocation; JSONGetElement ( $json ; "birthLocation" ) ]
                                                                                                                      • Set Field [ Belgian EID Reader::birthDateAsString; JSONGetElement ( $json ; "birthDateAsString" ) ]
                                                                                                                      • Set Field [ Belgian EID Reader::gender; JSONGetElement ( $json ; "gender" ) ]
                                                                                                                      • Set Field [ Belgian EID Reader::nobleCondition; JSONGetElement ( $json ; "nobleCondition" ) ]
                                                                                                                      • Set Field [ Belgian EID Reader::documentType; JSONGetElement ( $json ; "documentType" ) ]
                                                                                                                      • Set Field [ Belgian EID Reader::specialStatus; JSONGetElement ( $json ; "specialStatus" ) ]
                                                                                                                      • Set Field [ Belgian EID Reader::residenceStreetAndNr; JSONGetElement ( $json ; "residenceStreetAndNr" ) ]
                                                                                                                      • Set Field [ Belgian EID Reader::residencePostalCode; JSONGetElement ( $json ; "residencePostalCode" ) ]
                                                                                                                      • Set Field [ Belgian EID Reader::residenceMunicipality; JSONGetElement ( $json ; "residenceMunicipality" ) ]
                                                                                                                      • #the photo was passed as a hex string, decode it an write it to the photo field
                                                                                                                      • Set Field [ Belgian EID Reader::photo; MBS( "Container.DecodeFromHex"; "JPEG" ; JSONGetElement ( $json ; "photo" ) ; JSONGetElement ( $json ; "cardNumber" ) & ".jpg" ) ]
                                                                                                                      • If [ MBS("IsError") ]
                                                                                                                      • Show Custom Dialog [ Title: "Error"; Message: MBS( "FM.VariableGet"; "smartcard.pictureConversionError" ) & $r; Default Button: “OK”, Commit: “Yes” ]
                                                                                                                      • End If
                                                                                                                      • Commit Records/Requests [ No dialog ]
                                                                                                                      • #done, hide progress window
                                                                                                                      • Set Variable [ $r; Value:MBS("ProgressDialog.Hide") ]
                                                                                                                      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

                                                                                                                            Previous Script: [[button] read eid card]Next Script: [Read me for more information]
                                                                                                                            Script Name[button] sign document
                                                                                                                            Run script with full access privilegesOff
                                                                                                                            Include In MenuNo
                                                                                                                            Layouts that use this script
                                                                                                                              Scripts that use this script
                                                                                                                                Script Definition
                                                                                                                                Script Steps
                                                                                                                                • #============================================================================================================
                                                                                                                                • #Purpose: interface script that passes a document to sign to the subscript and writes the signature file in the same folder
                                                                                                                                • #Parameters: none
                                                                                                                                • #Called From: button on layout
                                                                                                                                • #Author: Peter Wagemans - Clarify
                                                                                                                                • #Notes: none
                                                                                                                                • #Revision: 2019/11/11: initial, not working yet
                                                                                                                                • #============================================================================================================
                                                                                                                                • #initialize text strings if not done yet
                                                                                                                                • If [ not MBS( "FM.VariableExists"; "smartcard.stringsInitialised" ) ]
                                                                                                                                • Perform Script [ “[sub] init text strings” ]
                                                                                                                                • End If
                                                                                                                                • #pick a file
                                                                                                                                • Set Variable [ $r; Value:MBS("FileDialog.Reset") ]
                                                                                                                                • Set Variable [ $r; Value:MBS("FileDialog.SetWindowTitle"; "window title" ) ]
                                                                                                                                • Set Variable [ $r; Value:MBS("FileDialog.SetInitialDirectory"; MBS( "Folders.UserDesktop" ) ) ]
                                                                                                                                • Set Variable [ $r; Value:MBS("FileDialog.SetShowHidden"; 1 ) ]
                                                                                                                                • Set Variable [ $r; Value:MBS("FileDialog.SetPrompt"; "Sign" ) ]
                                                                                                                                • Set Variable [ $r; Value:MBS("FileDialog.SetMessage"; "message" ) ]
                                                                                                                                • Set Variable [ $r; Value:MBS("FileDialog.OpenFileDialog") ]
                                                                                                                                • If [ $r ≠ MBS ( "Plugin.GetSuccessReturn" ) ]
                                                                                                                                • Exit Script [ ]
                                                                                                                                • End If
                                                                                                                                • Set Variable [ $filePath; Value:MBS("FileDialog.GetPath"; 0 ) ]
                                                                                                                                • #this subscript actually does not work yet
                                                                                                                                • Perform Script [ “[sub] sign document (not OK yet)”; Parameter: JSONSetElement ( "" ; "filePath" ; MBS("FileDialog.GetPath"; 0 ) ; JSONString ) ]
                                                                                                                                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

                                                                                                                                            Previous Script: [[button] sign document]Next Script: [visit https://www.clarify.net]
                                                                                                                                            Script NameRead me for more information
                                                                                                                                            Run script with full access privilegesOff
                                                                                                                                            Include In MenuYes
                                                                                                                                            Layouts that use this script
                                                                                                                                              Scripts that use this script
                                                                                                                                                Script Definition
                                                                                                                                                Script Steps
                                                                                                                                                • #============================================================================================================
                                                                                                                                                • #Purpose: Documentation
                                                                                                                                                • #Parameters: none
                                                                                                                                                • #Called From: Scripts Menu
                                                                                                                                                • #Author: Peter Wagemans - Clarify, Nederlandstalig FileMaker Forum - https://www.clarify.net
                                                                                                                                                • #Notes: This solution can read Belgian EID card and provide "ID" and address information as a JSON array
                                                                                                                                                • #Notes: It requires a SmartCard reader, but does not require the Belgian EID middleware, because it reads the card directly
                                                                                                                                                • #Notes: It also requires the FileMaker MBS plug-in ≥ 9.5.0.10
                                                                                                                                                • #Notes: This solution works on macOS and Windows FileMaker Pro clients, and has been tested with FileMaker Pro Advanced 17 and 18
                                                                                                                                                • #Notes: This solution consists of a [button] script that drives all [sub] scripts
                                                                                                                                                • #Notes: The [sub] scripts do not use any FileMaker field or variable, and therefore completely abstracted for easy implementation
                                                                                                                                                • #Notes: FM.Variables are used instead, making smartcard variables available accross multiple files
                                                                                                                                                • #Notes: Since this solution is used in Belgium, all interface components are translated in the 3 national languages plus English
                                                                                                                                                • #Notes: The example layout is in Dutch, I didn't bother :-)
                                                                                                                                                • #Notes: To implement in your own solution, copy and paste the [sub] and [button] scripts
                                                                                                                                                • #Notes: Then adapt the [button] script to match the fields with the result of the JSON array
                                                                                                                                                • #Notes: This solution is SmileWare. If you like it, remember to smile :-)
                                                                                                                                                • #Revision: 2019/11/11: initial
                                                                                                                                                • #============================================================================================================
                                                                                                                                                • Open Script Workspace
                                                                                                                                                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

                                                                                                                                                              Previous Script: [Read me for more information]
                                                                                                                                                              Script Namevisit https://www.clarify.net
                                                                                                                                                              Run script with full access privilegesOff
                                                                                                                                                              Include In MenuYes
                                                                                                                                                              Layouts that use this script
                                                                                                                                                                Scripts that use this script
                                                                                                                                                                  Script Definition
                                                                                                                                                                  Script Steps
                                                                                                                                                                  • #============================================================================================================
                                                                                                                                                                  • #Purpose: visit the Dutch FileMaker forum
                                                                                                                                                                  • #Parameters: none
                                                                                                                                                                  • #Called From: Scripts Menu
                                                                                                                                                                  • #Author: Peter Wagemans - Clarify
                                                                                                                                                                  • #Notes: none
                                                                                                                                                                  • #Revision: 2019/11/11: initial
                                                                                                                                                                  • #============================================================================================================
                                                                                                                                                                  • Open URL [ "https://www.clarify.net" ] [ No dialog ]
                                                                                                                                                                  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

                                                                                                                                                                                subscripts

                                                                                                                                                                                Parent Folder: [subscripts]Next Script: [[sub] init SmartCard lib]
                                                                                                                                                                                Script Name[sub] init text strings
                                                                                                                                                                                Run script with full access privilegesOff
                                                                                                                                                                                Include In MenuNo
                                                                                                                                                                                Layouts that use this script
                                                                                                                                                                                  Scripts that use this script
                                                                                                                                                                                  Script Definition
                                                                                                                                                                                  Script Steps
                                                                                                                                                                                  • #============================================================================================================
                                                                                                                                                                                  • #Purpose: read Belgian EID card and provide "ID" and address information as a JSON array
                                                                                                                                                                                  • #Parameters: none
                                                                                                                                                                                  • #Called From: [button] read eid card
                                                                                                                                                                                  • #Author: Peter Wagemans - Clarify
                                                                                                                                                                                  • #Notes: initialises text strings used in messages
                                                                                                                                                                                  • #Notes: has been translated using google, you might want to adapt some strings :-)
                                                                                                                                                                                  • #Notes: Belgian official languages + English are currently supported, other languages can be added.
                                                                                                                                                                                  • #Notes: FileMaker also supports Italian, Swedish, Spanish,, Japanese, Simplified Chinese, Brazilian Portuguese and Korean
                                                                                                                                                                                  • #Revision: 2019/11/11: initial
                                                                                                                                                                                  • #============================================================================================================
                                                                                                                                                                                  • Set Variable [ $lang; Value:Get ( ApplicationLanguage ) ]
                                                                                                                                                                                  • If [ $lang = "Dutch" ]
                                                                                                                                                                                  • #[button] read eid card
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.ProgressDialog.TopText" ; "SmartCard wordt gelezen..." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.pictureConversionError" ; "De foto gegevens op de EID kaart konden niet worden geconverteerd naar een foto.¶Error Message: " ) ]
                                                                                                                                                                                  • #[sub] init SmartCard lib
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.failedSmartCardInit" ; "Het MBS SmartCard systeem kon niet geinitialiseerd worden." ) ]
                                                                                                                                                                                  • #[sub] select reader
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.noReadersFound" ; "Geen SmartCard lezers gevonden." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.multipleReadersFound" ; "Meerdere kaartlezers gedetecteerd" ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.pleaseSelectCardReader" ; "Selecteer welke kaartlezer je wil gebruiken:" ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.noReaderSelected" ; "Er is geen SmartCard lezer geslecteerd." ) ]
                                                                                                                                                                                  • #[sub] connect card
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.connectionFailed" ; "De kaartlezer kon niet worden verbonden.¶Kijk na of de kaart goed is ingestoken." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.couldNotGetActiveProtocol" ; "Het actieve protocol van de SmartCard kon niet worden opgehaald." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.couldNotSetProtocolHeader" ; "Het was niet mogelijk om de actieve protocol header template in te stellen." ) ]
                                                                                                                                                                                  • #[sub] read eid card
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.select3F00Failed" ; "Dit lijkt geen geldige Belgische EID kaart.¶De 3F00 map kon niet geslecteerd worden." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.selectDF01Failed" ; "De DF01 map kon niet geselecteerd worden." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.select4031Failed" ; "De 4031 sectie van de kaart kon niet gelezen worden." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.4031InvalidData" ; "De 4031 (ID) sectie van de kaart bevat ongeldige gegevens." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.select4033Failed" ; "De 4033 (adres) sectie van de kaart kon niet gelezen worden." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.4033InvalidData" ; "De 4033 (adres) sectie van de kaart bevat ongeldige gegevens." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.select4035Failed" ; "De 4035 (foto) sectie van de kaart kon niet gelezen worden." ) ]
                                                                                                                                                                                  • Else If [ $lang = "French" ]
                                                                                                                                                                                  • #[button] read eid card
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.ProgressDialog.TopText" ; "Lecture du SmartCard ..." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.pictureConversionError" ; "La photo de la carte n'a pas pu être convertie en image.¶Message d'erreur:" ) ]
                                                                                                                                                                                  • #[sub] init SmartCard lib
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.failedSmartCardInit" ; "Échec d'initialisation du système MBS SmartCard." ) ]
                                                                                                                                                                                  • #[sub] select reader
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.noReadersFound" ; "Aucun lecteur de SmartCard trouvé." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.multipleReadersFound" ; "Plusieurs lecteurs de cartes détectés" ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.pleaseSelectCardReader" ; "Veuillez sélectionner le lecteur de carte à utiliser:" ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.noReaderSelected" ; "Aucun lecteur de carte à puce n'a été sélectionné." ) ]
                                                                                                                                                                                  • #[sub] connect card
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.connectionFailed" ; "La connexion à la carte dans le lecteur a échoué.¶Assurez-vous que la carte EID est correctement insérée." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.couldNotGetActiveProtocol" ; "Impossible d'obtenir le protocole actif du SmartCard." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.couldNotSetProtocolHeader" ; "Impossible de définir un modèle d'en-tête de protocole actif." ) ]
                                                                                                                                                                                  • #[sub] read eid card
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.select3F00Failed" ; "Cela ne semble pas être une carte EID belge valide. Le dossier 3F00 n'a pas pu être sélectionné.." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.selectDF01Failed" ; "Le dossier DF01 n'a pas pu être sélectionné." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.select4031Failed" ; "La section 4031 de la carte n'a pas pu être lue." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.4031InvalidData" ; "La section 4031 (ID) de la carte contient des données non valides." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.select4033Failed" ; "La section 4033 (adresse) de la carte n'a pas pu être lue." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.4033InvalidData" ; "La section 4033 (adresse) de la carte contient des données non valides." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.select4035Failed" ; "La section 4035 (photo) de la carte n'a pas pu être lue." ) ]
                                                                                                                                                                                  • Else If [ $lang = "German" ]
                                                                                                                                                                                  • #[button] read eid card
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.ProgressDialog.TopText" ; "SmartCard wird gelesen ..." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.pictureConversionError" ; "Das Kartenfoto konnte nicht in ein Bild konvertiert werden.¶Fehlermeldung: " ) ]
                                                                                                                                                                                  • #[sub] init SmartCard lib
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.failedSmartCardInit" ; "Fehler beim Initialisieren des MBS-SmartCard-Systems." ) ]
                                                                                                                                                                                  • #[sub] select reader
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.noReadersFound" ; "Keine SmartCard-Leser gefunden." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.multipleReadersFound" ; "Mehrere Kartenleser erkannt" ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.pleaseSelectCardReader" ; "Bitte wählen Sie den zu verwendenden Kartenleser aus:" ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.noReaderSelected" ; "Es wurde kein SmartCard-Leser ausgewählt." ) ]
                                                                                                                                                                                  • #[sub] connect card
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.connectionFailed" ; "Verbindung zur Karte im Lesegerät fehlgeschlagen.¶Vergewissern Sie sich, dass die EID-Karte richtig eingelegt ist." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.couldNotGetActiveProtocol" ; "Es kann kein aktives Protokoll von der SmartCard abgerufen werden." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.couldNotSetProtocolHeader" ; "Aktive Protokollheader-Vorlage kann nicht festgelegt werden." ) ]
                                                                                                                                                                                  • #[sub] read eid card
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.select3F00Failed" ; "Dies scheint keine gültige belgische EID-Karte zu sein.¶Der 3F00-Ordner konnte nicht ausgewählt werden." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.selectDF01Failed" ; "Der DF01-Ordner konnte nicht ausgewählt werden." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.select4031Failed" ; "Der Abschnitt 4031 der Karte konnte nicht gelesen werden." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.4031InvalidData" ; "Der Abschnitt 4031 (ID) der Karte enthält ungültige Daten." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.select4033Failed" ; "Der Abschnitt 4033 (Adresse) der Karte konnte nicht gelesen werden." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.4033InvalidData" ; "Der Abschnitt 4033 (Adresse) der Karte enthält ungültige Daten." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.select4035Failed" ; "Der Abschnitt 4035 (Foto) der Karte konnte nicht gelesen werden." ) ]
                                                                                                                                                                                  • Else
                                                                                                                                                                                  • #[button] read eid card
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.ProgressDialog.TopText" ; "Reading SmartCard..." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.pictureConversionError" ; "The card photo could not be converted to an image.¶Error Message: " ) ]
                                                                                                                                                                                  • #[sub] init SmartCard lib
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.failedSmartCardInit" ; "Failed to initialize MBS SmartCard system." ) ]
                                                                                                                                                                                  • #[sub] select reader
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.noReadersFound" ; "No SmartCard readers found." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.multipleReadersFound" ; "Multiple card readers detected" ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.pleaseSelectCardReader" ; "Please select which card reader to use:" ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.noReaderSelected" ; "No SmartCard reader has been selected." ) ]
                                                                                                                                                                                  • #[sub] connect card
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.connectionFailed" ; "Connection to card in reader did not succeed.¶Make sure the EID card is properly inserted." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.couldNotGetActiveProtocol" ; "Unable to obtain active protocol from SmartCard." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.couldNotSetProtocolHeader" ; "Unable to set active protocol header template." ) ]
                                                                                                                                                                                  • #[sub] read eid card
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.select3F00Failed" ; "This does not seem to be a valid Belgian EID card.¶The 3F00 folder could not be selected." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.selectDF01Failed" ; "The DF01 folder could not be selected." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.select4031Failed" ; "The 4031 section of the card could not be read." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.4031InvalidData" ; "The 4031 (ID) section of the card contains invalid data." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.select4033Failed" ; "The 4033 (address) section of the card could not be read." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.4033InvalidData" ; "The 4033 (address) section of the card contains invalid data." ) ]
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.select4035Failed" ; "The 4035 (photo) section of the card could not be read." ) ]
                                                                                                                                                                                  • End If
                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.stringsInitialised" ; True ) ]
                                                                                                                                                                                  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

                                                                                                                                                                                                Previous Script: [[sub] init text strings]Parent Folder: [subscripts]Next Script: [[sub] select reader]
                                                                                                                                                                                                Script Name[sub] init SmartCard lib
                                                                                                                                                                                                Run script with full access privilegesOff
                                                                                                                                                                                                Include In MenuNo
                                                                                                                                                                                                Layouts that use this script
                                                                                                                                                                                                  Scripts that use this script
                                                                                                                                                                                                  Script Definition
                                                                                                                                                                                                  Script Steps
                                                                                                                                                                                                  • #============================================================================================================
                                                                                                                                                                                                  • #Purpose: subroutine that initialises the MBS plug-in SmartCard functions
                                                                                                                                                                                                  • #Parameters: none
                                                                                                                                                                                                  • #Called From: [sub] read eid card
                                                                                                                                                                                                  • #Author: Peter Wagemans - Clarify
                                                                                                                                                                                                  • #Notes: none
                                                                                                                                                                                                  • #Revision: 2019/11/11: initial
                                                                                                                                                                                                  • #============================================================================================================
                                                                                                                                                                                                  • If [ not MBS( "FM.VariableExists"; "smartcard.libRef" ) ]
                                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.libRef" ; MBS( "SmartCard.Init" ) ) ]
                                                                                                                                                                                                  • Else If [ not MBS( "SmartCard.Valid"; MBS("FM.VariableGet";"smartcard.libRef") ) ]
                                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.libRef" ; MBS( "SmartCard.Init" ) ) ]
                                                                                                                                                                                                  • End If
                                                                                                                                                                                                  • If [ MBS("IsError") ]
                                                                                                                                                                                                  • Set Variable [ $errorMBS; Value:MBS( "FM.VariableGet"; "smartcard.libRef" ) ]
                                                                                                                                                                                                  • Set Variable [ $r; Value:MBS( "FM.VariableClear"; "smartcard.libRef" ) ]
                                                                                                                                                                                                  • Exit Script [ Result: JSONSetElement ( "" ; [ "error" ; 1 ; JSONNumber ] ; [ "errorMessage" ; MBS( "FM.VariableGet"; "smartcard.failedSmartCardInit" ) ; JSONString ] ; [ "errorMBS" ; $errorMBS ; JSONString ] ) ]
                                                                                                                                                                                                  • End If
                                                                                                                                                                                                  • Exit Script [ Result: JSONSetElement ( $json ; "error" ; 0 ; JSONNumber ) ]
                                                                                                                                                                                                  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

                                                                                                                                                                                                                Previous Script: [[sub] init SmartCard lib]Parent Folder: [subscripts]Next Script: [[sub] connect card]
                                                                                                                                                                                                                Script Name[sub] select reader
                                                                                                                                                                                                                Run script with full access privilegesOff
                                                                                                                                                                                                                Include In MenuNo
                                                                                                                                                                                                                Layouts that use this script
                                                                                                                                                                                                                  Scripts that use this script
                                                                                                                                                                                                                  Script Definition
                                                                                                                                                                                                                  Script Steps
                                                                                                                                                                                                                  • #============================================================================================================
                                                                                                                                                                                                                  • #Purpose: subroutine that selects the SmartCard reader
                                                                                                                                                                                                                  • #Parameters: none
                                                                                                                                                                                                                  • #Called From: [sub] read eid card
                                                                                                                                                                                                                  • #Author: Peter Wagemans - Clarify
                                                                                                                                                                                                                  • #Notes: none
                                                                                                                                                                                                                  • #Revision: 2019/11/11: initial
                                                                                                                                                                                                                  • #============================================================================================================
                                                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableClear"; "smartcard.reader" ) ]
                                                                                                                                                                                                                  • #examine which reader is connected, this function returns empty when no card readers are connected
                                                                                                                                                                                                                  • Set Variable [ $list; Value:MBS( "SmartCard.ListReaders"; MBS("FM.VariableGet";"smartcard.libRef") ) ]
                                                                                                                                                                                                                  • Set Variable [ $count; Value:ValueCount ( $list ) ]
                                                                                                                                                                                                                  • If [ $count < 1 ]
                                                                                                                                                                                                                  • Exit Script [ Result: JSONSetElement ( "" ; [ "error" ; 1 ; JSONNumber ] ; [ "errorMessage" ; MBS( "FM.VariableGet"; "smartcard. smartcard.noReadersFound" ) ; JSONString ] ; [ "errorMBS" ; "" ; JSONString ] ) ]
                                                                                                                                                                                                                  • Else If [ $count > 1 ]
                                                                                                                                                                                                                  • #multiple card readers detected, give choice which card reader to use
                                                                                                                                                                                                                  • Set Variable [ $r; Value:MBS("ListDialog.SetWindowTitle"; MBS( "FM.VariableGet"; "smartcard.multipleReadersFound" ) ) ]
                                                                                                                                                                                                                  • Set Variable [ $r; Value:MBS("ListDialog.SetPrompt"; MBS( "FM.VariableGet"; "smartcard.pleaseSelectCardReader" ) ) ]
                                                                                                                                                                                                                  • Set Variable [ $r; Value:MBS("ListDialog.SetHeight";200) ]
                                                                                                                                                                                                                  • Set Variable [ $r; Value:MBS("ListDialog.SetWidth";300) ]
                                                                                                                                                                                                                  • Set Variable [ $r; Value:MBS("ListDialog.ClearList") ]
                                                                                                                                                                                                                  • Set Variable [ $r; Value:MBS("ListDialog.AddItemsToList"; $list ) ]
                                                                                                                                                                                                                  • Set Variable [ $r; Value:MBS("ListDialog.ShowDialog") ]
                                                                                                                                                                                                                  • Set Variable [ $r; Value:MBS("ListDialog.GetSelectedTitle") ]
                                                                                                                                                                                                                  • If [ not IsEmpty ( $r ) ]
                                                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.reader" ; $r ) ]
                                                                                                                                                                                                                  • End If
                                                                                                                                                                                                                  • Else
                                                                                                                                                                                                                  • Set Variable [ $r; Value: MBS( "FM.VariableSet"; "smartcard.reader" ; $list ) ]
                                                                                                                                                                                                                  • End If
                                                                                                                                                                                                                  • Exit Script [ Result: JSONSetElement ( $json ; [ "error" ; not MBS( "FM.VariableExists"; "smartcard.reader" ) ; JSONNumber ] ; [ "errorMessage" ; MBS( "FM.VariableGet"; "smartcard.noReaderSelected" ) ; JSONString ] // will not process with error 0 ) ]
                                                                                                                                                                                                                  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

                                                                                                                                                                                                                                Previous Script: [[sub] select reader]Parent Folder: [subscripts]Next Script: [[sub] read eid card]
                                                                                                                                                                                                                                Script Name[sub] connect card
                                                                                                                                                                                                                                Run script with full access privilegesOff
                                                                                                                                                                                                                                Include In MenuNo
                                                                                                                                                                                                                                Layouts that use this script
                                                                                                                                                                                                                                  Scripts that use this script
                                                                                                                                                                                                                                  Script Definition
                                                                                                                                                                                                                                  Script Steps
                                                                                                                                                                                                                                  • #============================================================================================================
                                                                                                                                                                                                                                  • #Purpose: subroutine that connects to the card in the selected reader
                                                                                                                                                                                                                                  • #Parameters: none
                                                                                                                                                                                                                                  • #Called From: [sub] read eid card
                                                                                                                                                                                                                                  • #Author: Peter Wagemans - Clarify
                                                                                                                                                                                                                                  • #Notes: none
                                                                                                                                                                                                                                  • #Revision: 2019/11/11: initial
                                                                                                                                                                                                                                  • #============================================================================================================
                                                                                                                                                                                                                                  • Set Variable [ $r; Value:MBS( "SmartCard.Connect"; MBS("FM.VariableGet";"smartcard.libRef") ; MBS("FM.VariableGet";"smartcard.reader") ; "Shared"; "any" ) ]
                                                                                                                                                                                                                                  • If [ MBS("IsError") ]
                                                                                                                                                                                                                                  • Exit Script [ Result: JSONSetElement ( "" ; [ "error" ; 1 ; JSONNumber ] ; [ "errorMessage" ; MBS( "FM.VariableGet"; "smartcard.connectionFailed" ) ; JSONString ] ; [ "errorMBS" ; $r ; JSONString ] ) ]
                                                                                                                                                                                                                                  • End If
                                                                                                                                                                                                                                  • #get the active protocol of the reader
                                                                                                                                                                                                                                  • Set Variable [ $activeProtocol; Value:MBS("SmartCard.GetActiveProtocol"; MBS("FM.VariableGet";"smartcard.libRef") ) ]
                                                                                                                                                                                                                                  • If [ MBS("IsError") ]
                                                                                                                                                                                                                                  • Exit Script [ Result: JSONSetElement ( "" ; [ "error" ; 1 ; JSONNumber ] ; [ "errorMessage" ; MBS( "FM.VariableGet"; "smartcard.couldNotGetActiveProtocol" ) ; JSONString ] ; [ "errorMBS" ; $r ; JSONString ] ) ]
                                                                                                                                                                                                                                  • End If
                                                                                                                                                                                                                                  • #set the header template for further communications
                                                                                                                                                                                                                                  • Set Variable [ $headerTemplate; Value:MBS( "SmartCard.HeaderTemplate"; $activeProtocol ; MBS("FM.VariableGet";"smartcard.libRef") ) ]
                                                                                                                                                                                                                                  • If [ MBS("IsError") ]
                                                                                                                                                                                                                                  • Exit Script [ Result: JSONSetElement ( "" ; [ "error" ; 1 ; JSONNumber ] ; [ "errorMessage" ; MBS( "FM.VariableGet"; "smartcard.couldNotSetProtocolHeader" ); JSONString ] ; [ "errorMBS" ; $r ; JSONString ] ) ]
                                                                                                                                                                                                                                  • End If
                                                                                                                                                                                                                                  • Set Variable [ $r; Value:MBS ( "FM.VariableSet" ; "smartcard.protocolHeader" ; $headerTemplate ) ]
                                                                                                                                                                                                                                  • Exit Script [ Result: JSONSetElement ( $json ; "error" ; 0 ; JSONNumber ) ]
                                                                                                                                                                                                                                  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

                                                                                                                                                                                                                                                Previous Script: [[sub] connect card]Parent Folder: [subscripts]Next Script: [[sub] lower level photo read]
                                                                                                                                                                                                                                                Script Name[sub] read eid card
                                                                                                                                                                                                                                                Run script with full access privilegesOff
                                                                                                                                                                                                                                                Include In MenuNo
                                                                                                                                                                                                                                                Layouts that use this script
                                                                                                                                                                                                                                                  Scripts that use this script
                                                                                                                                                                                                                                                  Script Definition
                                                                                                                                                                                                                                                  Script Steps
                                                                                                                                                                                                                                                  • #============================================================================================================
                                                                                                                                                                                                                                                  • #Purpose: core subroutine that tries to read an inserted Belgian EID card
                                                                                                                                                                                                                                                  • #Parameters: none
                                                                                                                                                                                                                                                  • #Called From: [button] read eid card
                                                                                                                                                                                                                                                  • #Author: Peter Wagemans - Clarify
                                                                                                                                                                                                                                                  • #Notes: we access the card directly, not using the EID middleware
                                                                                                                                                                                                                                                  • #Notes: chip number is not correct, has to be decoded somehow, maybe not possible without middleware
                                                                                                                                                                                                                                                  • #Revision: 2019/11/11: initial
                                                                                                                                                                                                                                                  • #Revision: 2019/11/19: redefined encoding of read strings from "native" to "UTF-8"
                                                                                                                                                                                                                                                  • #Revision: 2019/11/25: added a low level photo read for debug purposes
                                                                                                                                                                                                                                                  • #Revision: 2020/05/23: workaround for Vasco card reader problem - do not select directory, but access files directly
                                                                                                                                                                                                                                                  • #Notes: 2019/11/25: the script sets the MBS plug-in into debug mode if it encounters a photo read error, and creates a mail with the trace file attached.
                                                                                                                                                                                                                                                  • #============================================================================================================
                                                                                                                                                                                                                                                  • #init smartcard lib if necessary
                                                                                                                                                                                                                                                  • If [ not MBS( "FM.VariableExists"; "smartcard.libRef" ) ]
                                                                                                                                                                                                                                                  • Perform Script [ “[sub] init SmartCard lib” ]
                                                                                                                                                                                                                                                  • If [ JSONGetElement ( Get ( ScriptResult ) ; "error" ) ≠ 0 ]
                                                                                                                                                                                                                                                  • Exit Script [ Result: Get ( ScriptResult ) ]
                                                                                                                                                                                                                                                  • End If
                                                                                                                                                                                                                                                  • End If
                                                                                                                                                                                                                                                  • #connect to smartcard reader if not already connected
                                                                                                                                                                                                                                                  • If [ not MBS( "FM.VariableExists"; "smartcard.reader" ) ]
                                                                                                                                                                                                                                                  • Perform Script [ “[sub] select reader” ]
                                                                                                                                                                                                                                                  • If [ JSONGetElement ( Get ( ScriptResult ) ; "error" ) ≠ 0 ]
                                                                                                                                                                                                                                                  • Exit Script [ Result: Get ( ScriptResult ) ]
                                                                                                                                                                                                                                                  • End If
                                                                                                                                                                                                                                                  • End If
                                                                                                                                                                                                                                                  • #connect to the card in the reader
                                                                                                                                                                                                                                                  • Perform Script [ “[sub] connect card” ]
                                                                                                                                                                                                                                                  • If [ JSONGetElement ( Get ( ScriptResult ) ; "error" ) ≠ 0 ]
                                                                                                                                                                                                                                                  • Exit Script [ Result: Get ( ScriptResult ) ]
                                                                                                                                                                                                                                                  • End If
                                                                                                                                                                                                                                                  • #the belgian eid card structure looks like this:
                                                                                                                                                                                                                                                  • #<?xml version="1.0" encoding="UTF-8"?> <folder> name="MF" code=".3F00" <file>name="EF_DIR" code=".2F00"</file> <folder> name="DF_BELPIC" code=".DF00" <file>name="EF_ODF" code=".5031"</file> <file>name="EF_TokenInfo" code=".5032"</file> <file>name="EF_AODF" code=".5034"</file> <file>name="EF_PrKDF" code=".5035"</file> <file>name="EF_CDF" code=".5037"</file> <file>name="EF_Cert#2" code=".5038"</file> <file>name="EF_Cert#3" code=".5039"</file> <file>name="EF_Cert#4" code=".503A"</file> <file>name="EF_Cert#6" code=".503B"</file> <file>name="EF_Cert#8" code=".503C"</file> </folder> <folder> name="DF_ID" code=".DF01" <file>name="EF_ID#RN" code=".4031"</file> // this file contains eid text data ( id ) <file>name="EF_SGN#RN" code=".4032"</file> <file>name="EF_ID#Address" code=".4033"</file> // this file contains eid text data ( address ) <file>name="EF_SGN#Address" code=".4034"</file> <file>name="EF_ID#Photo" code=".4035"</file> // this file contains the eid photo ( JPEG ) <file>name="EF_PuK#7" code=".4038"</file> <file>name="EF_Preferences" code=".4039"</file> </folder> </folder>
                                                                                                                                                                                                                                                  • // #select 3F00 folder, if this folder does not exists, this is probably not a Belgian EID card
                                                                                                                                                                                                                                                  • // Set Variable [ $r; Value:MBS ( "SmartCard.Transmit" ; MBS ( "FM.VariableGet" ; "smartcard.libRef" ) ; MBS ( "FM.VariableGet" ; "smartcard.protocolHeader" ) ; "00A4020C02" & "3F00" & "00" ; 4 ) ]
                                                                                                                                                                                                                                                  • // If [ $r ≠ "9000" ]
                                                                                                                                                                                                                                                  • // Exit Script [ Result: JSONSetElement ( "" ; [ "error" ; 1 ; JSONNumber ] ; [ "errorMessage" ; MBS( "FM.VariableGet"; "smartcard.select3F00Failed" ) ; JSONString ] ; [ "errorMBS" ; $r ; JSONString ] ) ]
                                                                                                                                                                                                                                                  • // End If
                                                                                                                                                                                                                                                  • // #select DF01 folder
                                                                                                                                                                                                                                                  • // Set Variable [ $r; Value:MBS ( "SmartCard.Transmit" ; MBS ( "FM.VariableGet" ; "smartcard.libRef" ) ; MBS ( "FM.VariableGet" ; "smartcard.protocolHeader" ) ; "00A4020C02" & "DF01" & "00" ; 4 ) ]
                                                                                                                                                                                                                                                  • // If [ $r ≠ "9000" ]
                                                                                                                                                                                                                                                  • // Exit Script [ Result: JSONSetElement ( "" ; [ "error" ; 1 ; JSONNumber ] ; [ "errorMessage" ; MBS( "FM.VariableGet"; "smartcard.selectDF01Failed" ) ; JSONString ] ; [ "errorMBS" ; $r ; JSONString ] ) ]
                                                                                                                                                                                                                                                  • // End If
                                                                                                                                                                                                                                                  • #read 4031 entry
                                                                                                                                                                                                                                                  • Set Variable [ $r; Value:MBS( "SmartCard.ReadFile"; MBS ( "FM.VariableGet" ; "smartcard.libRef" ) ; "DF014031" ; "hex" ) ]
                                                                                                                                                                                                                                                  • If [ MBS("IsError") ]
                                                                                                                                                                                                                                                  • Exit Script [ Result: JSONSetElement ( "" ; [ "error" ; 1 ; JSONNumber ] ; [ "errorMessage" ; MBS( "FM.VariableGet"; "smartcard.select4031Failed" ); JSONString ] ; [ "errorMBS" ; $r ; JSONString ] ) ]
                                                                                                                                                                                                                                                  • Else
                                                                                                                                                                                                                                                  • Set Variable [ $personalJson; Value:MBS("SmartCard.SplitValues"; $r ) ]
                                                                                                                                                                                                                                                  • End If
                                                                                                                                                                                                                                                  • #personal json array should contain:
                                                                                                                                                                                                                                                  • #{ "1": "<card number>", "2": "<chip number>", "3": "<start card validity>", "4": "<stop card validity", "5": "<municipality that delivered this card>", "6": "<national number>", "7": "<last name>", "8": "<first given names ( first name and second name)>", "9": "<first letter of 3the given name>", "10":"<nationality>", "11":"<birth location>", "12":"<birth date as string (better use national number to parse birth date)>", "13":"<gender (M/F?)>", "14":"<noble condition>", "15":"<document type (01)>", "16":"<special status (0)>" }
                                                                                                                                                                                                                                                  • If [ Left ( JSONFormatElements ( $personalJson ) ; 1 ) = "?" ]
                                                                                                                                                                                                                                                  • Exit Script [ Result: JSONSetElement ( "" ; [ "error" ; 1 ; JSONNumber ] ; [ "errorMessage" ; MBS( "FM.VariableGet"; "smartcard.4031InvalidData" ) ; JSONString ] ; [ "errorMBS" ; $personalJSON ; JSONString ] ) ]
                                                                                                                                                                                                                                                  • End If
                                                                                                                                                                                                                                                  • #we convert this to a json array that has proper labels
                                                                                                                                                                                                                                                  • #we know the chip number is not correct, but we convert it to hex to avoid showing gremlin bytes
                                                                                                                                                                                                                                                  • Set Variable [ $json; Value:JSONSetElement ( "" ; [ "cardNumber" ; JSONGetElement ( $personalJson ; "1" ) ; JSONString ] ; [ "cardChipNumber" ; MBS( "Text.EncodeToHex"; JSONGetElement ( $personalJson ; "2" ) ) ; JSONString ] ; [ "cardValidityStart" ; JSONGetElement ( $personalJson ; "3" ) ; JSONString ] ; [ "cardValidityStop" ; JSONGetElement ( $personalJson ; "4" ) ; JSONString ] ; [ "cardDeliveryMunicipality" ; MBS( "Text.RedefineEncoding" ; JSONGetElement ( $personalJson ; "5" ) ;"Native" ; "UTF8" ) ; JSONString ] ; [ "nationalNumber" ; JSONGetElement ( $personalJson ; "6" ) ; JSONString ] ; [ "nameLast" ; MBS( "Text.RedefineEncoding" ; JSONGetElement ( $personalJson ; "7" ) ;"Native" ; "UTF8" ) ; JSONString ] ; [ "namesFirstAndSecond" ; MBS( "Text.RedefineEncoding" ; JSONGetElement ( $personalJson ; "8" ) ;"Native" ; "UTF8" ) ; JSONString ] ; [ "nameThirdFirstLetter" ; MBS( "Text.RedefineEncoding" ; JSONGetElement ( $personalJson ; "9" ) ;"Native" ; "UTF8" ) ; JSONString ] ; [ "nationality" ; MBS( "Text.RedefineEncoding" ; JSONGetElement ( $personalJson ; "10" ) ;"Native" ; "UTF8" ) ; JSONString ] ; [ "birthLocation" ; MBS( "Text.RedefineEncoding" ; JSONGetElement ( $personalJson ; "11" ) ;"Native" ; "UTF8" ) ; JSONString ] ; [ "birthDateAsString" ; JSONGetElement ( $personalJson ; "12" ) ; JSONString ] ; [ "gender" ; JSONGetElement ( $personalJson ; "13" ) ; JSONString ] ; [ "nobleCondition" ; JSONGetElement ( $personalJson ; "14" ) ; JSONString ] ; [ "documentType" ; JSONGetElement ( $personalJson ; "15" ) ; JSONString ] ; [ "specialStatus" ; JSONGetElement ( $personalJson ; "16" ) ; JSONString ] ) ]
                                                                                                                                                                                                                                                  • #read 4033 entry
                                                                                                                                                                                                                                                  • Set Variable [ $r; Value:MBS( "SmartCard.ReadFile"; MBS ( "FM.VariableGet" ; "smartcard.libRef" ) ; "DF014033" ; "hex" ) ]
                                                                                                                                                                                                                                                  • If [ MBS("IsError") ]
                                                                                                                                                                                                                                                  • Exit Script [ Result: JSONSetElement ( "" ; [ "error" ; 1 ; JSONNumber ] ; [ "errorMessage" ; MBS( "FM.VariableGet"; "smartcard.select4033Failed" ) ; JSONString ] ; [ "errorMBS" ; $r ; JSONString ] ) ]
                                                                                                                                                                                                                                                  • Else
                                                                                                                                                                                                                                                  • Set Variable [ $addressJson; Value:MBS("SmartCard.SplitValues"; $r ) ]
                                                                                                                                                                                                                                                  • End If
                                                                                                                                                                                                                                                  • #address json array should contain:
                                                                                                                                                                                                                                                  • #{ "1": "<street & nr>", "2": "postalCode", "3": "municipality" }
                                                                                                                                                                                                                                                  • If [ Left ( JSONFormatElements ( $addressJson ) ; 1 ) = "?" ]
                                                                                                                                                                                                                                                  • Exit Script [ Result: JSONSetElement ( "" ; [ "error" ; 1 ; JSONNumber ] ; [ "errorMessage" ; MBS( "FM.VariableGet"; "smartcard.4033InvalidData") ; JSONString ] ; [ "errorMBS" ; $addressJson ; JSONString ] ) ]
                                                                                                                                                                                                                                                  • End If
                                                                                                                                                                                                                                                  • #we add this to our json array with proper labels
                                                                                                                                                                                                                                                  • Set Variable [ $json; Value:JSONSetElement ( $json ; [ "residenceStreetAndNr" ; MBS( "Text.RedefineEncoding" ; JSONGetElement ( $addressJson ; "1" ) ;"Native" ; "UTF8" ) ; JSONString ] ; [ "residencePostalCode" ; MBS( "Text.RedefineEncoding" ; JSONGetElement ( $addressJson ; "2" ) ;"Native" ; "UTF8" ) ; JSONString ] ; [ "residenceMunicipality" ; MBS( "Text.RedefineEncoding" ; JSONGetElement ( $addressJson ; "3" ) ;"Native" ; "UTF8" ) ; JSONString ] ) ]
                                                                                                                                                                                                                                                  • #photo
                                                                                                                                                                                                                                                  • Set Variable [ $r; Value:MBS( "SmartCard.ReadFile"; MBS ( "FM.VariableGet" ; "smartcard.libRef" ) ; "DF014035" ; "hex" ) ]
                                                                                                                                                                                                                                                  • If [ MBS("IsError") ]
                                                                                                                                                                                                                                                  • #enter debug mode
                                                                                                                                                                                                                                                  • Set Variable [ $debugPath; Value:MBS( "Path.AddPathComponent"; MBS( "Folders.UserTemporary" ) ; "eid_debug.txt" ) ]
                                                                                                                                                                                                                                                  • Set Variable [ $r; Value:MBS( "Trace" ; $debugPath; 0 ) ]
                                                                                                                                                                                                                                                  • #do it again, logging the problem
                                                                                                                                                                                                                                                  • Set Variable [ $r; Value:MBS( "SmartCard.ReadFile"; MBS ( "FM.VariableGet" ; "smartcard.libRef" ) ; "DF014035" ; "hex" ) ]
                                                                                                                                                                                                                                                  • #read the file using transmit commands
                                                                                                                                                                                                                                                  • Perform Script [ “[sub] lower level photo read” ]
                                                                                                                                                                                                                                                  • Set Variable [ $resultJSON; Value:Get ( ScriptResult ) ]
                                                                                                                                                                                                                                                  • #exit debug mode
                                                                                                                                                                                                                                                  • Set Variable [ $void; Value:MBS( "Trace.Off" ) ]
                                                                                                                                                                                                                                                  • #error or no error, send a mail with the debug log as enclosure
                                                                                                                                                                                                                                                  • Set Variable [ $enclosurePath; Value:MBS( "Path.NativePathToFileMakerPath"; $debugPath ) ]
                                                                                                                                                                                                                                                  • Send Mail [ Send via E-mail Client; To: "peter@nospam.clarify.net"; Subject: "Error reading photo"; Message: "Hi there.¶We encountered a problem reading the photo, and have tried to debug the problem.¶Please send this email which has a debug log, so we can find out what was the problem exactly.¶Thanks!¶Peter"; Attachments: “$enclosurePath” ]
                                                                                                                                                                                                                                                  • If [ JSONGetElement ( $resultJSON ; "error" ) ≠ 0 ]
                                                                                                                                                                                                                                                  • Exit Script [ Result: $resultJSON ]
                                                                                                                                                                                                                                                  • Else
                                                                                                                                                                                                                                                  • Set Variable [ $r; Value:JSONGetElement ( $resultJSON ; "data" ) ]
                                                                                                                                                                                                                                                  • End If
                                                                                                                                                                                                                                                  • End If
                                                                                                                                                                                                                                                  • Set Variable [ $json; Value:JSONSetElement ( $json ; "photo" ; $r ; JSONString ) ]
                                                                                                                                                                                                                                                  • #disconnect
                                                                                                                                                                                                                                                  • Set Variable [ $r; Value:MBS( "SmartCard.Disconnect"; MBS ( "FM.VariableGet" ; "smartcard.libRef" ) ; "Eject" ) ]
                                                                                                                                                                                                                                                  • #ready, exit with result
                                                                                                                                                                                                                                                  • Exit Script [ Result: JSONSetElement ( $json ; "error" ; 0 ; JSONNumber ) ]
                                                                                                                                                                                                                                                  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

                                                                                                                                                                                                                                                              Previous Script: [[sub] read eid card]Parent Folder: [subscripts]Next Script: [[sub] sign document (not OK yet)]
                                                                                                                                                                                                                                                              Script Name[sub] lower level photo read
                                                                                                                                                                                                                                                              Run script with full access privilegesOff
                                                                                                                                                                                                                                                              Include In MenuNo
                                                                                                                                                                                                                                                              Layouts that use this script
                                                                                                                                                                                                                                                                Scripts that use this script
                                                                                                                                                                                                                                                                Script Definition
                                                                                                                                                                                                                                                                Script Steps
                                                                                                                                                                                                                                                                • #============================================================================================================
                                                                                                                                                                                                                                                                • #Purpose: subroutine that retries to read a photo, after readfile failed
                                                                                                                                                                                                                                                                • #Parameters: none
                                                                                                                                                                                                                                                                • #Called From: [sub] read eid card
                                                                                                                                                                                                                                                                • #Author: Peter Wagemans - Clarify
                                                                                                                                                                                                                                                                • #Notes: this after some trouble experienced with certain eid cards
                                                                                                                                                                                                                                                                • #Revision: 2019/11/25: initial
                                                                                                                                                                                                                                                                • #Revision: 2019/11/27: added 6B error code
                                                                                                                                                                                                                                                                • #Revision: 2020/05/23: workaround for Vasco card reader problem - do not select directory, but access files directly
                                                                                                                                                                                                                                                                • #============================================================================================================
                                                                                                                                                                                                                                                                • #init smartcard lib if necessary
                                                                                                                                                                                                                                                                • If [ not MBS( "FM.VariableExists"; "smartcard.libRef" ) ]
                                                                                                                                                                                                                                                                • Perform Script [ “[sub] init SmartCard lib” ]
                                                                                                                                                                                                                                                                • If [ JSONGetElement ( Get ( ScriptResult ) ; "error" ) ≠ 0 ]
                                                                                                                                                                                                                                                                • Exit Script [ Result: Get ( ScriptResult ) ]
                                                                                                                                                                                                                                                                • End If
                                                                                                                                                                                                                                                                • End If
                                                                                                                                                                                                                                                                • #connect to smartcard reader if not already connected
                                                                                                                                                                                                                                                                • If [ not MBS( "FM.VariableExists"; "smartcard.reader" ) ]
                                                                                                                                                                                                                                                                • Perform Script [ “[sub] select reader” ]
                                                                                                                                                                                                                                                                • If [ JSONGetElement ( Get ( ScriptResult ) ; "error" ) ≠ 0 ]
                                                                                                                                                                                                                                                                • Exit Script [ Result: Get ( ScriptResult ) ]
                                                                                                                                                                                                                                                                • End If
                                                                                                                                                                                                                                                                • End If
                                                                                                                                                                                                                                                                • #connect to the card in the reader
                                                                                                                                                                                                                                                                • Perform Script [ “[sub] connect card” ]
                                                                                                                                                                                                                                                                • If [ JSONGetElement ( Get ( ScriptResult ) ; "error" ) ≠ 0 ]
                                                                                                                                                                                                                                                                • Exit Script [ Result: Get ( ScriptResult ) ]
                                                                                                                                                                                                                                                                • End If
                                                                                                                                                                                                                                                                • // #select correct folder on card
                                                                                                                                                                                                                                                                • // #select 3F00 folder, if this folder does not exists, this is probably not a Belgian EID card
                                                                                                                                                                                                                                                                • // Set Variable [ $r; Value:MBS ( "SmartCard.Transmit" ; MBS ( "FM.VariableGet" ; "smartcard.libRef" ) ; MBS ( "FM.VariableGet" ; "smartcard.protocolHeader" ) ; "00A4020C02" & "3F00" & "00" ; 4 ) ]
                                                                                                                                                                                                                                                                • // If [ $r ≠ "9000" ]
                                                                                                                                                                                                                                                                • // Exit Script [ Result: JSONSetElement ( "" ; [ "error" ; 1 ; JSONNumber ] ; [ "errorMessage" ; MBS( "FM.VariableGet"; "smartcard.select3F00Failed" ) ; JSONString ] ; [ "errorMBS" ; $r ; JSONString ] ) ]
                                                                                                                                                                                                                                                                • // End If
                                                                                                                                                                                                                                                                • // #select DF01 folder
                                                                                                                                                                                                                                                                • // Set Variable [ $r; Value:MBS ( "SmartCard.Transmit" ; MBS ( "FM.VariableGet" ; "smartcard.libRef" ) ; MBS ( "FM.VariableGet" ; "smartcard.protocolHeader" ) ; "00A4020C02" & "DF01" & "00" ; 4 ) ]
                                                                                                                                                                                                                                                                • // If [ $r ≠ "9000" ]
                                                                                                                                                                                                                                                                • // Exit Script [ Result: JSONSetElement ( "" ; [ "error" ; 1 ; JSONNumber ] ; [ "errorMessage" ; MBS( "FM.VariableGet"; "smartcard.selectDF01Failed" ) ; JSONString ] ; [ "errorMBS" ; $r ; JSONString ] ) ]
                                                                                                                                                                                                                                                                • // End If
                                                                                                                                                                                                                                                                • #select photo
                                                                                                                                                                                                                                                                • Set Variable [ $r; Value:MBS ( "SmartCard.Transmit" ; MBS ( "FM.VariableGet" ; "smartcard.libRef" ) ; MBS ( "FM.VariableGet" ; "smartcard.protocolHeader" ) ; "00A4" & "080C" & "04" & "DF01" & "4035" & "00" ; 4 ) ]
                                                                                                                                                                                                                                                                • If [ $r ≠ "9000" ]
                                                                                                                                                                                                                                                                • Exit Script [ Result: JSONSetElement ( "" ; [ "error" ; 1 ; JSONNumber ] ; [ "errorMessage" ; "select photo failed" ; JSONString ] ; [ "errorMBS" ; $r ; JSONString ] ) ]
                                                                                                                                                                                                                                                                • End If
                                                                                                                                                                                                                                                                • Set Variable [ $i; Value:0 ]
                                                                                                                                                                                                                                                                • Set Variable [ $data; Value:"" ]
                                                                                                                                                                                                                                                                • Loop
                                                                                                                                                                                                                                                                • Set Variable [ $start; Value:MBS( "Text.EncodeToHex"; MBS( "Text.Character"; $i ) ) ]
                                                                                                                                                                                                                                                                • Set Variable [ $r; Value:MBS ( "SmartCard.Transmit" ; MBS ( "FM.VariableGet" ; "smartcard.libRef" ) ; MBS ( "FM.VariableGet" ; "smartcard.protocolHeader" ) ; "00B0" & $start & "00" & "00" ; 516 ) ]
                                                                                                                                                                                                                                                                • Set Variable [ $reply; Value:Right ( $r ; 4 ) ]
                                                                                                                                                                                                                                                                • Exit Loop If [ $reply ≠ "9000" ]
                                                                                                                                                                                                                                                                • Set Variable [ $data; Value:$data & Left ( $r ; Length ( $r ) - 4 ) ]
                                                                                                                                                                                                                                                                • Set Variable [ $i; Value:$i + 1 ]
                                                                                                                                                                                                                                                                • End Loop
                                                                                                                                                                                                                                                                • Set Variable [ $errCode; Value:Left ( $reply ; 2 ) ]
                                                                                                                                                                                                                                                                • If [ $errCode = "6C" // wrong length ]
                                                                                                                                                                                                                                                                • Set Variable [ $lengthByte; Value:Right ( $reply ; 2 ) ]
                                                                                                                                                                                                                                                                • Set Variable [ $r; Value:MBS ( "SmartCard.Transmit" ; MBS ( "FM.VariableGet" ; "smartcard.libRef" ) ; MBS ( "FM.VariableGet" ; "smartcard.protocolHeader" ) ; "00B0" & $start & "00" & $lengthByte ; 516 ) ]
                                                                                                                                                                                                                                                                • Set Variable [ $reply; Value:Right ( $r ; 4 ) ]
                                                                                                                                                                                                                                                                • If [ $reply = "9000" ]
                                                                                                                                                                                                                                                                • Set Variable [ $data; Value:$data & Left ( $r ; Length ( $r ) - 4 ) ]
                                                                                                                                                                                                                                                                • Else
                                                                                                                                                                                                                                                                • #error
                                                                                                                                                                                                                                                                • Exit Script [ Result: JSONSetElement ( "" ; [ "error" ; 1 ; JSONNumber ] ; [ "errorMessage" ; MBS( "FM.VariableGet"; "smartcard.select4035Failed" ) ; JSONString ] ; [ "errorMBS" ; $r ; JSONString ] ) ]
                                                                                                                                                                                                                                                                • End If
                                                                                                                                                                                                                                                                • Else If [ $errCode = "6B" // nothing more to come, offset outside the EF ]
                                                                                                                                                                                                                                                                • #done
                                                                                                                                                                                                                                                                • Else
                                                                                                                                                                                                                                                                • #error
                                                                                                                                                                                                                                                                • Exit Script [ Result: JSONSetElement ( "" ; [ "error" ; 1 ; JSONNumber ] ; [ "errorMessage" ; MBS( "FM.VariableGet"; "smartcard.select4035Failed" ) ; JSONString ] ; [ "errorMBS" ; $r ; JSONString ] ) ]
                                                                                                                                                                                                                                                                • End If
                                                                                                                                                                                                                                                                • Exit Script [ Result: JSONSetElement ( "" ; [ "error" ; 0 ; JSONNumber ] ; [ "data" ; $data ; JSONString ] ) ]
                                                                                                                                                                                                                                                                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

                                                                                                                                                                                                                                                                            Previous Script: [[sub] lower level photo read]Parent Folder: [subscripts]Next Script: [[sub] analyse card contents]
                                                                                                                                                                                                                                                                            Script Name[sub] sign document (not OK yet)
                                                                                                                                                                                                                                                                            Run script with full access privilegesOff
                                                                                                                                                                                                                                                                            Include In MenuNo
                                                                                                                                                                                                                                                                            Layouts that use this script
                                                                                                                                                                                                                                                                              Scripts that use this script
                                                                                                                                                                                                                                                                              Script Definition
                                                                                                                                                                                                                                                                              Script Steps
                                                                                                                                                                                                                                                                              • #============================================================================================================
                                                                                                                                                                                                                                                                              • #Purpose: subroutine that retries to read a photo, after readfile failed
                                                                                                                                                                                                                                                                              • #Parameters: none
                                                                                                                                                                                                                                                                              • #Called From: [sub] read eid card
                                                                                                                                                                                                                                                                              • #Author: Peter Wagemans - Clarify
                                                                                                                                                                                                                                                                              • #Notes: none
                                                                                                                                                                                                                                                                              • #Revision: 2019/11/25: initial, not working, plug-in is taking wrong cert file I think
                                                                                                                                                                                                                                                                              • #============================================================================================================
                                                                                                                                                                                                                                                                              • #init smartcard lib if necessary
                                                                                                                                                                                                                                                                              • If [ not MBS( "FM.VariableExists"; "smartcard.libRef" ) ]
                                                                                                                                                                                                                                                                              • Perform Script [ “[sub] init SmartCard lib” ]
                                                                                                                                                                                                                                                                              • If [ JSONGetElement ( Get ( ScriptResult ) ; "error" ) ≠ 0 ]
                                                                                                                                                                                                                                                                              • Exit Script [ Result: Get ( ScriptResult ) ]
                                                                                                                                                                                                                                                                              • End If
                                                                                                                                                                                                                                                                              • End If
                                                                                                                                                                                                                                                                              • #connect to smartcard reader if not already connected
                                                                                                                                                                                                                                                                              • If [ not MBS( "FM.VariableExists"; "smartcard.reader" ) ]
                                                                                                                                                                                                                                                                              • Perform Script [ “[sub] select reader” ]
                                                                                                                                                                                                                                                                              • If [ JSONGetElement ( Get ( ScriptResult ) ; "error" ) ≠ 0 ]
                                                                                                                                                                                                                                                                              • Exit Script [ Result: Get ( ScriptResult ) ]
                                                                                                                                                                                                                                                                              • End If
                                                                                                                                                                                                                                                                              • End If
                                                                                                                                                                                                                                                                              • #connect to the card in the reader
                                                                                                                                                                                                                                                                              • Perform Script [ “[sub] connect card” ]
                                                                                                                                                                                                                                                                              • If [ JSONGetElement ( Get ( ScriptResult ) ; "error" ) ≠ 0 ]
                                                                                                                                                                                                                                                                              • Exit Script [ Result: Get ( ScriptResult ) ]
                                                                                                                                                                                                                                                                              • End If
                                                                                                                                                                                                                                                                              • Set Variable [ $filePath; Value:JSONGetElement ( Get ( ScriptParameter ) ; "filePath" ) ]
                                                                                                                                                                                                                                                                              • Set Variable [ $hash; Value:MBS( "Hash.Digest"; "SHA1"; "Path"; $filePath ; ""; "Hex"; "" ) ]
                                                                                                                                                                                                                                                                              • #not working
                                                                                                                                                                                                                                                                              • Set Variable [ $signature; Value:MBS( "SmartCard.PerformSignature"; MBS ( "FM.VariableGet" ; "smartcard.libRef" ) ; "cardos" ; $hash ) ]
                                                                                                                                                                                                                                                                              • If [ MBS("IsError") ]
                                                                                                                                                                                                                                                                              • Show Custom Dialog [ Title: "Error"; Message: $signature; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                                                                                                                                                                                                                              • End If
                                                                                                                                                                                                                                                                              • // Exit Script [ Result: JSONSetElement ( "" ; [ "error" ; 1 ; JSONNumber ] ; [ "errorMessage" ; MBS( "FM.VariableGet"; "smartcard.select4035Failed" ) ; JSONString ] ; [ "errorMBS" ; $r ; JSONString ] ) ]
                                                                                                                                                                                                                                                                              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

                                                                                                                                                                                                                                                                                          Previous Script: [[sub] sign document (not OK yet)]Parent Folder: [subscripts]
                                                                                                                                                                                                                                                                                          Script Name[sub] analyse card contents
                                                                                                                                                                                                                                                                                          Run script with full access privilegesOff
                                                                                                                                                                                                                                                                                          Include In MenuNo
                                                                                                                                                                                                                                                                                          Layouts that use this script
                                                                                                                                                                                                                                                                                            Scripts that use this script
                                                                                                                                                                                                                                                                                              Script Definition
                                                                                                                                                                                                                                                                                              Script Steps
                                                                                                                                                                                                                                                                                              • #============================================================================================================
                                                                                                                                                                                                                                                                                              • #Purpose: subroutine that fetches all data from the card as a JSON array
                                                                                                                                                                                                                                                                                              • #Parameters: none
                                                                                                                                                                                                                                                                                              • #Called From: none
                                                                                                                                                                                                                                                                                              • #Author: Peter Wagemans - Clarify
                                                                                                                                                                                                                                                                                              • #Notes: none
                                                                                                                                                                                                                                                                                              • #Revision: 2019/11/27: initial
                                                                                                                                                                                                                                                                                              • #Revision: 2020/05/23: workaround for Vasco card reader problem - do not select directory, but access files directly
                                                                                                                                                                                                                                                                                              • #============================================================================================================
                                                                                                                                                                                                                                                                                              • #this does not declare the variable, just documenting output
                                                                                                                                                                                                                                                                                              • Set Variable [ $json; Value:"" ]
                                                                                                                                                                                                                                                                                              • #init smartcard lib if necessary
                                                                                                                                                                                                                                                                                              • If [ not MBS( "FM.VariableExists"; "smartcard.libRef" ) ]
                                                                                                                                                                                                                                                                                              • Perform Script [ “[sub] init SmartCard lib” ]
                                                                                                                                                                                                                                                                                              • If [ JSONGetElement ( Get ( ScriptResult ) ; "error" ) ≠ 0 ]
                                                                                                                                                                                                                                                                                              • Exit Script [ Result: Get ( ScriptResult ) ]
                                                                                                                                                                                                                                                                                              • End If
                                                                                                                                                                                                                                                                                              • End If
                                                                                                                                                                                                                                                                                              • #connect to smartcard reader if not already connected
                                                                                                                                                                                                                                                                                              • If [ not MBS( "FM.VariableExists"; "smartcard.reader" ) ]
                                                                                                                                                                                                                                                                                              • Perform Script [ “[sub] select reader” ]
                                                                                                                                                                                                                                                                                              • If [ JSONGetElement ( Get ( ScriptResult ) ; "error" ) ≠ 0 ]
                                                                                                                                                                                                                                                                                              • Exit Script [ Result: Get ( ScriptResult ) ]
                                                                                                                                                                                                                                                                                              • End If
                                                                                                                                                                                                                                                                                              • End If
                                                                                                                                                                                                                                                                                              • #connect to the card in the reader
                                                                                                                                                                                                                                                                                              • Perform Script [ “[sub] connect card” ]
                                                                                                                                                                                                                                                                                              • If [ JSONGetElement ( Get ( ScriptResult ) ; "error" ) ≠ 0 ]
                                                                                                                                                                                                                                                                                              • Exit Script [ Result: Get ( ScriptResult ) ]
                                                                                                                                                                                                                                                                                              • End If
                                                                                                                                                                                                                                                                                              • #here's a JSON array we will loop through
                                                                                                                                                                                                                                                                                              • Insert Text [ $structure ] [ Select ]
                                                                                                                                                                                                                                                                                              • Set Variable [ $level; Value:0 ]
                                                                                                                                                                                                                                                                                              • Set Variable [ $i[$level]; Value:0 ]
                                                                                                                                                                                                                                                                                              • Loop
                                                                                                                                                                                                                                                                                              • Set Variable [ $selector; Value:<Function Missing> ( [ string = "" ; level = $level ; myLevel = 0 ] ; myLevel ≤ $level ; [ string = string & "." & $i[myLevel] ; myLevel = myLevel + 1 ] ; string ) ]
                                                                                                                                                                                                                                                                                              • Exit Loop If [ $selector = ".0.3" // since our JSON array ends after .0.2 ]
                                                                                                                                                                                                                                                                                              • Set Variable [ $kind; Value:JSONGetElement ( $structure ; $selector & ".kind" ) ]
                                                                                                                                                                                                                                                                                              • If [ $kind = "folder" ]
                                                                                                                                                                                                                                                                                              • Set Variable [ $nodeCount; Value:ValueCount ( FilterValues ( JSONListKeys ( $structure ; $selector ) ; "0¶1¶2¶3¶4¶5¶6¶7¶8¶9" ) ) ]
                                                                                                                                                                                                                                                                                              • Set Variable [ $folderCode; Value:JSONGetElement ( $structure ; $selector & ".code" ) ]
                                                                                                                                                                                                                                                                                              • // Set Variable [ $r; Value:MBS ( "SmartCard.Transmit" ; MBS ( "FM.VariableGet" ; "smartcard.libRef" ) ; MBS ( "FM.VariableGet" ; "smartcard.protocolHeader" ) ; "00A4020C02" & $code & "00" ; 4 ) ]
                                                                                                                                                                                                                                                                                              • // If [ $r ≠ "9000" ]
                                                                                                                                                                                                                                                                                              • // Exit Script [ Result: JSONSetElement ( $json ; [ "error" ; 1 ; JSONNumber ] ; [ "errorMessage" ; "select " & $code & " failed." ; JSONString ] ; [ "errorMBS" ; $r ; JSONString ] ) ]
                                                                                                                                                                                                                                                                                              • // End If
                                                                                                                                                                                                                                                                                              • Set Variable [ $level; Value:$level + 1 ]
                                                                                                                                                                                                                                                                                              • Set Variable [ $i[$level]; Value:0 ]
                                                                                                                                                                                                                                                                                              • Else If [ $kind = "file" ]
                                                                                                                                                                                                                                                                                              • Set Variable [ $code; Value:JSONGetElement ( $structure ; $selector & ".code" ) ]
                                                                                                                                                                                                                                                                                              • Set Variable [ $r; Value:MBS ( "SmartCard.Transmit" ; MBS ( "FM.VariableGet" ; "smartcard.libRef" ) ; MBS ( "FM.VariableGet" ; "smartcard.protocolHeader" ) ; "00A4" & "080C" & "04" & $folderCode & $code & "00" ; 4 ) ]
                                                                                                                                                                                                                                                                                              • If [ $r ≠ "6A82" // file not found, happens with the preferences file ]
                                                                                                                                                                                                                                                                                              • If [ $r ≠ "9000" ]
                                                                                                                                                                                                                                                                                              • Exit Script [ Result: JSONSetElement ( $json ; [ "error" ; 1 ; JSONNumber ] ; [ "errorMessage" ; "select " & $code & " failed." ; JSONString ] ; [ "errorMBS" ; $r ; JSONString ] ) ]
                                                                                                                                                                                                                                                                                              • End If
                                                                                                                                                                                                                                                                                              • Set Variable [ $j; Value:0 ]
                                                                                                                                                                                                                                                                                              • Set Variable [ $data; Value:"" ]
                                                                                                                                                                                                                                                                                              • Loop
                                                                                                                                                                                                                                                                                              • Set Variable [ $start; Value:MBS( "Text.EncodeToHex"; MBS( "Text.Character"; $j ) ) ]
                                                                                                                                                                                                                                                                                              • Set Variable [ $r; Value:MBS ( "SmartCard.Transmit" ; MBS ( "FM.VariableGet" ; "smartcard.libRef" ) ; MBS ( "FM.VariableGet" ; "smartcard.protocolHeader" ) ; "00B0" & $start & "00" & "00" ; 516 ) ]
                                                                                                                                                                                                                                                                                              • Set Variable [ $reply; Value:Right ( $r ; 4 ) ]
                                                                                                                                                                                                                                                                                              • Exit Loop If [ $reply ≠ "9000" ]
                                                                                                                                                                                                                                                                                              • Set Variable [ $data; Value:$data & Left ( $r ; Length ( $r ) - 4 ) ]
                                                                                                                                                                                                                                                                                              • Set Variable [ $j; Value:$j+ 1 ]
                                                                                                                                                                                                                                                                                              • End Loop
                                                                                                                                                                                                                                                                                              • Set Variable [ $errCode; Value:Left ( $reply ; 2 ) ]
                                                                                                                                                                                                                                                                                              • If [ $errCode = "6C" // wrong length ]
                                                                                                                                                                                                                                                                                              • Set Variable [ $lengthByte; Value:Right ( $reply ; 2 ) ]
                                                                                                                                                                                                                                                                                              • Set Variable [ $r; Value:MBS ( "SmartCard.Transmit" ; MBS ( "FM.VariableGet" ; "smartcard.libRef" ) ; MBS ( "FM.VariableGet" ; "smartcard.protocolHeader" ) ; "00B0" & $start & "00" & $lengthByte ; 516 ) ]
                                                                                                                                                                                                                                                                                              • Set Variable [ $reply; Value:Right ( $r ; 4 ) ]
                                                                                                                                                                                                                                                                                              • If [ $reply = "9000" ]
                                                                                                                                                                                                                                                                                              • Set Variable [ $data; Value:$data & Left ( $r ; Length ( $r ) - 4 ) ]
                                                                                                                                                                                                                                                                                              • Else
                                                                                                                                                                                                                                                                                              • #error
                                                                                                                                                                                                                                                                                              • Exit Script [ Result: JSONSetElement ( $json ; [ "error" ; 1 ; JSONNumber ] ; [ "errorMessage" ; MBS( "FM.VariableGet"; "smartcard.select4035Failed" ) ; JSONString ] ; [ "errorMBS" ; $r ; JSONString ] ) ]
                                                                                                                                                                                                                                                                                              • End If
                                                                                                                                                                                                                                                                                              • Else If [ $errCode = "6B" // nothing more to come, offset outside the EF ]
                                                                                                                                                                                                                                                                                              • #done
                                                                                                                                                                                                                                                                                              • Else
                                                                                                                                                                                                                                                                                              • #error
                                                                                                                                                                                                                                                                                              • Exit Script [ Result: JSONSetElement ( $json ; [ "error" ; 1 ; JSONNumber ] ; [ "errorMessage" ; MBS( "FM.VariableGet"; "smartcard.select4035Failed" ) ; JSONString ] ; [ "errorMBS" ; $r ; JSONString ] ) ]
                                                                                                                                                                                                                                                                                              • End If
                                                                                                                                                                                                                                                                                              • End If
                                                                                                                                                                                                                                                                                              • Set Variable [ $format; Value:JSONGetElement ( $structure ; $selector & ".format" ) ]
                                                                                                                                                                                                                                                                                              • If [ $format = "tlv" ]
                                                                                                                                                                                                                                                                                              • Set Variable [ $test; Value:MBS("SmartCard.SplitValues"; $data ) ]
                                                                                                                                                                                                                                                                                              • End If
                                                                                                                                                                                                                                                                                              • Set Variable [ $json; Value:JSONSetElement ( $json ; $code ; $data ; JSONString ) ]
                                                                                                                                                                                                                                                                                              • Set Variable [ $i[$level]; Value:$i[$level] + 1 ]
                                                                                                                                                                                                                                                                                              • Else If [ $i[$level] >= $nodeCount ]
                                                                                                                                                                                                                                                                                              • Set Variable [ $level; Value:$level - 1 ]
                                                                                                                                                                                                                                                                                              • Set Variable [ $i[$level]; Value:$i[$level] + 1 ]
                                                                                                                                                                                                                                                                                              • #select the root folder again
                                                                                                                                                                                                                                                                                              • Set Variable [ $r; Value:MBS ( "SmartCard.Transmit" ; MBS ( "FM.VariableGet" ; "smartcard.libRef" ) ; MBS ( "FM.VariableGet" ; "smartcard.protocolHeader" ) ; "00A4020C02" & "3F" & "00" ; 4 ) ]
                                                                                                                                                                                                                                                                                              • If [ $r ≠ "9000" ]
                                                                                                                                                                                                                                                                                              • Exit Script [ Result: JSONSetElement ( $json ; [ "error" ; 1 ; JSONNumber ] ; [ "errorMessage" ; "select " & $code & " failed." ; JSONString ] ; [ "errorMBS" ; $r ; JSONString ] ) ]
                                                                                                                                                                                                                                                                                              • End If
                                                                                                                                                                                                                                                                                              • Else
                                                                                                                                                                                                                                                                                              • Exit Script [ Result: JSONSetElement ( $json ; [ "error" ; 1 ; JSONNumber ] ; [ "errorMessage" ; "invalid kind for node " & $code ; JSONString ] ; [ "errorMBS" ; $r ; JSONString ] ) ]
                                                                                                                                                                                                                                                                                              • End If
                                                                                                                                                                                                                                                                                              • End Loop
                                                                                                                                                                                                                                                                                              • Exit Script [ Result: JSONSetElement ( $json ; [ "error" ; 0 ; JSONNumber ] ; [ "data" ; $data ; JSONString ] ) ]
                                                                                                                                                                                                                                                                                              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: Belgian EID Reader

                                                                                                                                                                                                                                                                                                          Used functions: