Running FileMaker Scripts from Your Desktop with Launchy or Alfred


Here is a cool trick, a method of running FileMaker Pro scripts directly from the Desktop on Mac or Windows computers. My friend Joshua Paul of Neo Code Software sent me an email with the headline “Launchy/Alfred + FileMaker FMP URI = AWESOME“. Josh is often coming up with innovative approaches to technical challenges, so I thought I would give it a try and was impressed enough to want to share it with a wider audience.

The basic idea is to install a Desktop launcher app like Launchy (Windows and Mac) or Alfred (Mac only) and then write a custom URI call to a script in a FileMaker Pro database, sending a parameter with the request. Inside your FileMaker Pro database, you will need to have a script waiting to accept the outside request and parameter sent.

What it looks like in action is, from the Desktop, the user types a special keyboard command to bring up one of the launchers (for example Option-Space for Alfred, or Control-Space for Launchy). Then they enter a pre-defined syntax to request a FileMaker search. In the example Joshua sent me, he used the term ‘INV’ and then typed a Receipt ID number and hit enter to execute the search. FileMaker Pro pops up with the database and runs the search. Instant FileMaker searches from anywhere!—what could be better?

What is the payback for a technique like this you ask and who is it for?

keyboard.png

Less Clicks

  • Ctrl+Space – 1 click
  • ‘INV’ Space – 4 clicks
  • Search Term – FileMaker’s search power means that you can use just a minimum number of unique characters to search on something. So for example, if you are looking for the term ‘Periscope’, all you need to type is ‘Peri’
  • Total to Search 5 clicks plus a Search Term.

The user can get to any work order, invoice or client record from ANY screen on their computer in less than 10 clicks. Basically it is putting FileMaker at your finger tips.

Target market:

  • A person who works in lots of other programs, and needs to do quick lookups or run the same few scripts in a FileMaker Pro database multiple times every day. They don’t want to have to figure out which screen to go to in the FileMaker solution and find the right button to push.
  • Keyboard lovers. The people who never want to take their hands off the keys.

Download an App Launcher

wpid3616-media_1378843200287.png

Launchy is donationware for both Windows and Mac. On the Mac, Launchy is not as well known as Alfred, which is free for the basic install.

Launching Launcy

wpid3617-media_1378843479363.png

Once Launchy is installed, Tap ALT-SPACE to open a Launchy window. The small gear icon opens the Launchy options window.

Configuring Launchy

wpid3612-media_1378842300228.png

1) Click on the small Gear icon on the Launchy main window
2) Go to Plugins tab
3) Choose weby
4) Add the shortcut using the following syntax:

fmp://YOUR_SERVER_NAME/YOUR_DATABASE_NAME?script=YOUR_SCRIPT_NAME&param=%1

The “%1” is where your script parameter will go when you type in your search.

Alfred Launcher

wpid3618-media_1378848724564.png

Click the little gear icon top right to configure a new FileMaker Pro search.

Alfred Setup—Add a Custom Web Search

wpid3614-media_1378842370308.png

Once Alfred is installed, launch it and add a custom URI Web Search.

1) Enter the Search URL, including space for the parameter query.
2) Give it a name.
3) Enter the keyword shortcut. This is what you will type to invoke the script from the Desktop.
4) For extra panache, add an icon copied from the FileMaker app.

The syntax for Alfred is slightly different:

fmp://YOUR_SERVER_NAME/YOUR_DATABASE_NAME?script=YOUR_SCRIPT_NAME&param={query}

If your database is running locally, leave out the “YOUR_SERVER_NAME/” component of the URI and use “YOUR_IP_ADDRESS”, for example, 192.168.1.112. Running the script against a local file will result in a duplicate window being opened and you are required to do a second log in. See previous blog posting about how the URI scheme works with locally hosted files.

Troubleshooting

wpid3619-media_1378858087620.png

Alfred doesn’t like spaces in File or Script Names. Note the space between ‘Serial’ and ‘Numbers’. Even clicking the ‘Encode spaces as +’ option does not get rid of the red text and let you click Save when building your query.

I tested the query with the ‘Encode spaces’ on and off. If you turn it on, you have to Substitute the plus signs out in your FileMaker search script. Not turning it on seems to be the best option, because FileMaker can handle the query with spaces.

Sample Script to call

wpid3620-media_1378858306696.png

Basically all you need to do is:
1) Set the Search parameter, using Get(ScriptParameter)
2) Give the script a name with no spaces.
3) then feed that parameter into a Find Records command.

Launchy invoking a FileMaker Pro script

wpid3613-media_1378842332409.png
  • Type INV (or WO or CO)
  • Hit the TAB key
  • Then type 30720 (invoice 30720)
  • Hit the ENTER key
  • Feel the POWER as FileMaker opens to the record of your choice!!

Alfred invoking a FileMaker Pro script

wpid3615-media_1378842390361.png

Type your shortcut word and the parameter that follows.

Limitations

geek.png
  • This is a FileMaker Pro 12 or better technique. It won’t run in previous versions which did not support a script parameter.
  • It is not dynamic — each script must be given a unique shortcut name and pre-configured in the launcher app. 
  • 2014-06-17 Update: Josh at Neo Code Software is working on making the script more dynamic by using a more generic header such as ‘FMP’ and then a number. If the number has four digits, it is a work order, if it has five to seven, it is an invoice, if it has ten digits it is a phone number. The script that gets called has Case statement for each possibility and runs a different script based on that branching.
  • User has to remember the shortcut name and syntax to perform a search
  • It also assumes you are already logged into the FileMaker database. If you are not logged in, you will be prompted for a password the first time you run the script. Although it is possible to embed user name and password in the URI Scheme, it is not advisable or secure to do so.
  • If the database is local, a second copy of the database is opened to perform the query. See discussion in previous blog posting.

 

Trackbacks/Pingbacks

  1. Running FileMaker Scripts from Your Desktop with Launchy or Alfred | HomeBase Software - FileMaker Pro Gurus - September 13, 2013

    […] More… Running FileMaker Scripts from Your Desktop with Launchy or Alfred | HomeBase Software. […]

  2. Running FileMaker Scripts from Your Desktop with Launchy or Alfred | Homebase | Filemaker Info - September 13, 2013

    […] See on hbase.net […]

%d bloggers like this: