Home Back E-mail



Using TWAIN to scan directly into FileMaker Pro


FileMaker Pro (FMP) v4 and v5 has no built-in feature to allow scanning images directly into a container field. If you do not want to use a plugin and work under Windows, here is a solution that will (hopefully) satisfy your needs for 99%:

Get freeware AutoIt v2.63 or higher from www.hiddensoft.com/autoit.
Get freeware IrfanView v3.61 + all plugins or higher from www.irfanview.com

Write the following textfile; my comments are bulleted and in italics. Be careful: window titles are case sensitive. Double backslashes are needed to represent a single backslash.

  • Run IrfanView
    run, C:\\Program Files\\irfanview\\i_view32.exe
  • Wait until IrfanView window becomes active
    WinWaitActive, IrfanView
  • Enter Alt-f ("File") or Alt-d (!d) ("Datei") for German Windows etc.
    Send, !d
  • Enter c for Scan (in IrfanView, German version; in the English version this might be a different character)
    Send, c
  • Wait until the scanner's window opens; I have a Canon N650U, its software is called ScanGear; adapt the title if necessary.The scanner settings must be set before your start it all (size, dpi etc.)
    WinWaitActive, ScanGear
  • Enter Alt-s (that starts *my* Canon scanning process)
    Send, !s
  • Wait until the scanned image appears in Irfanview
    WinWaitActive, ScanImage
  • Enter control-c to copy it
    Send, ^c
  • Close Irfanview
    WinClose, ScanImage
  • Awaken FMP
    WinActivate, FileMaker Pro
  • Paste image into the selected cotnainer field (see script below)
    Send, ^v

    Now save this as text file "fmptwain.aut" an compile it with Aut2exe.exe into "fmptwain.exe".

    In FMP you need a container field on a layout, and a 2 line script:
    Go to Field ["o.image"]
    Send Message ["fmptwain.exe", "aevt", "odoc"]
    This works fine, with one single exception (that is the remaining 1%): at the end the container field is still selected. You could avoid that with a sufficient pause before giving an additional "naked" Go to Field. FMP does not wait until an external app is finished (very nasty, would be nice for FMP v6). You would have to find out with testing your scanner etc. how long that pause would have to be.

    Good luck!

    Back to the list of my FileMaker Pro trouvailles

  • Home Back to Christoph Bouthillier Top

    © 1997...