Posts from the 'Filemaker' Category

FileMaker text fields. Select text but no editing.

Often users need to copy a post code an email address or a url  into another app. Often these fields are locked down to prevent accidental alteration or deletion. If this is done by FileMakers native  method of preventing field entry in Browse Mode  the user can’t select and copy the required text. Frustration all round.

One way to resolve this is to use a Revert Record Request Script combined with an OnObjectModify script trigger.

Take a look at the steps below using a simple FileMaker file with one table and 2 text fields.

textfields

 

Step 1) First the script… Nothing clever here, just a Revert Record Request followed by a Commit and a Custom Dialog explaining the Field is not editable.

script1

 

 

Step 2) Next Set the Script Trigger.

In this case we have set the No_Updating_please Field to Trigger the No Field Updating Script whenever modified. This uses the OnObjectModify option in the Set Script Triggers dialog.

set_script_trigger

 

Step 3) There is no step 3. Try it out for yourselves.

Users can select and copy…

copy

 

But if users try to Edit they are told “Updating is not Allowed”.

not_allowd

 

Published in the hope that this is useful to someone, somewhere, sometime.

Paul

 

 

 

Use FileMaker Pro 9 to connect to a SQL / MySQL data source

One of the really powerful features of FileMaker Pro 9 is the ability to connect directly to an SQL data source. This means you can create a FileMaker 9 interface for your clients and allow them to add/modify/browse/delete records on a SQL data source.

Setting up FileMaker Pro 9 to connect to a SQL data source is actually a little more complicated than the FileMaker marketing would have you believe. In this short tutorial, we’ll talk you through the steps of connecting to a MySQL data source using FileMaker Pro 9 on a Mac and Actual Technology’s ODBC drivers (yep, you need third party software – surprised?)

There are two steps to setting up your FileMaker to MySQL connection:

1) Set up your ODBC preferences
2) Set up FileMaker Pro 9

1) Set up your ODBC preferences

The first thing to do here is to go to Actual Technologies and get a copy of the ODBC driver you require. (NB. Metaclarity is not affiliated with Actual Technologies in any way – we just like their software). We’re running MySQL so we bought a copy of the Open Source Databases driver. If you don’t want to spend money on a driver there are some free drivers available on the internet, but for $29 Actual will make your task a LOT easier.

  • Run the Actual ODBC Driver Pack installer
  • Go through the legal steps then click customize and choose the driver you want to install: we only installed the “Actual ODBC Driver for Open Source Databases” as that was all we required to connect to MySQL
  • With the installation finished successfully go to the Utilities folder on your drive and open the application called: “ODBC Administrator”
  • Click on User DSN then click on the “Add… button”
  • Select Actual’s Driver in the list that appears.
  • Press “Continue” in the new pop-up window.
  • Choose an easy to remember name for your connection and description – these are not critical to the connection. For DSN type, choose System.
  • Choose your database type (here we chose MySQL)
  • Enter the IP for your MySQL server in the Server field. Port is usually 3306.
  • Set your username and password for connecting to your online MySQL database in Login ID and Password.
  • In the next window the name of your database should be available in the Database popup field. Select it now then press continue. Then press “Done”

Now in the ODBC Administrator application under the System DSN tab you’ll see your data source and you’re ready to connect with FileMaker Pro 9

2) Set up FileMaker Pro 9 to connect to SQL / MySQL

  • Launch FileMaker Pro 9
  • Create a new empty database.
  • Open the define database dialog: File>Manage>Database…
  • Go to Relationships and double click on the existing “test” table
  • For Data Source, choose Add ODBC data source….
  • Choose your MySQL source from the list and press “Continue…”
  • Most of the defaults in the following screen are fine though if you don’t want to be prompted for a password each time you connect then use “Specify user name and password”
  • Now choose the table you want to connect to and read. Your table will populate with the fields from this remote table.
  • Press OK and watch what happens – you’re using FileMaker Pro 9 to access a remote SQL data source! You can now use FileMaker’s layout functions etc. to make this layout more attractive and get to work on learning how to better integrate Filemaker Pro 9 and MySQL!

Filemaker Pro and ImageMagick

Filemaker Pro can store images in container fields. Wouldn’t it be great if it could also perform standard image manipulations on those stored images? Well with a combination of Filemaker Pro, ImageMagick and a little UNIX scripting, you can.

Here’s how:

1) Install ImageMagick on your system

2) Create a Filemaker Pro database with fields similar to the ones in the example file below or simply use our example

3) Copy the script from the example records below into your own version and Process your images.

Here’s the working example to download:
Filemaker and ImageMagick Example

You can also run ImageMagick image processing with AppleScript using “do shell script”. Here’s an example:

do shell script "cd ~/; ls"
do shell script "cd ~/; export MAGICK_HOME=\"$HOME/ImageMagick-6.3.2\" ;export PATH=\"$MAGICK_HOME/bin:$PATH\" ;export DYLD_LIBRARY_PATH=\"$MAGICK_HOME/lib\"; convert donj.bmp donj.jpg"