« MBS FileMaker Plugin,… | Home | MBS FileMaker Plugin,… »

Import images from cameras on MacOS with FileMaker

We got a few new ImageCapture functions to import images from camera on Mac. So if you can import in Photos.app or Image Capture.app, you can also import them in FileMaker.

For version 10.4 of our MBS Plugin we got a new function ImageCapture.SetItemsAddedScript to define which script to trigger when a new picture is there. So you first use ImageCapture.OpenDevice to connect to camera, then use ImageCapture.RequestEnableTethering to ask for tethering, later call ImageCapture.RequestTakePicture to take a picture. Once the picture is taken, you get the script triggered and there you get a JSON like this:

[
  {
    "orientation" : 0,
    "parentFolder" : "LocalCache",
    "UTI" : "public.image",
    "raw" : true,
    "name" : "IMG_0008.CR2",
    "creationDate" : "2020-08-27 13:30:38 +0000",
    "duration" : 0,
    "inTemporaryStore" : true,
    "largeThumbnail" : {
      "height" : 120,
      "width" : 160
    },
    "metadata" : {
      "PixelHeight" : 4000,
      "{Exif}" : {
        "DateTimeOriginal" : "2020:08:27 15:30:38",
        "DateTimeDigitized" : "2020:08:27 15:30:38"
      },
      "PixelWidth" : 6000
    },
    "fileSize" : 26156488,
    "device" : "Canon EOS 760D",
    "thumbnail" : {
      "height" : 120,
      "width" : 160
    },
    "sidecarFiles" : [

    ],
    "locked" : false,
    "userData" : {

    },
    "modificationDate" : "2020-08-27 13:30:38 +0000"
  }
]

Pick the file name and use ImageCapture.Download to get the image file from the camera and store it in FileMaker. If you like, use ImageCapture.RequestDeleteFiles to delete the file.

PS: For Xojo, you can do the same with our ImageCapture classes: ImageCaptureMBS Claris FileMaker Plugin
28 08 20 - 09:07