Tuesday, November 24, 2009

Filemaker - Using Growl without plugins

In this article I will show you how to create a simple Growl notification in FileMaker without additional plugins.

I have a FileMaker ToDo list, which can be filled by some people.
I wanted some kind of notification of new tasks they fill in it, without having to look at it all the time checking for new entries.

I already had Growl installed, so I thought why not use it as a notification? It has a sticky option which allows notifications to stay on the screen until I click on them. That was exactly what I needed.

That is where the following sample came from.

I didn't want to look for plugins (I am pretty sure there must be one for this), as I like to do things without plugins.
I started looking around for AppleScript samples how to use Growl, and found some on the Growl website. I modified those to run from FileMaker.

The Growl notification is a simple calculated Perform AppleScript command:

----

"tell application \"System Events\"¶

set isRunning to count of (every process whose name is \"GrowlHelperApp\") > 0¶

end tell¶

if isRunning then¶

tell application \"GrowlHelperApp\"¶


register as application \"GrowlSampleApp\" all notifications {"& Quote ("TestNotify") & "} default notifications {"& Quote ("TestNotify") & "} icon of application \"FileMaker Pro" & Case ( PatternCount ( Get ( ApplicationVersion ) ; "Advanced" ) ; " Advanced\"" ; "\"" ) & "¶


notify with name "& Quote ("TestNotify") & " title " & Quote (GrowlSample::Title) & " description " & Quote(GrowlSample::GrowlText) & " application name \"GrowlSampleApp\""& " sticky "& Quote (GrowlSample::Sticky) &"¶


end tell¶

end if¶"


----


The first part checks if Growl is up and running. The second part registers the application, and notifies with the set parameters.

The icon it shows is the Icon of FileMaker, but it can be changed to anything you wish.


We also have to check for Get(LastError) -609 to be sure.


I attached the sample file which you can download from here. (right click- save as!)



UPDATE: A commenter (doug says:) Here is a custom function that does a similar thing:http://www.briandunning.com/cf/1064


Based on ideas and code from Michael Gaslowitz http://www.gaslowitz.net/filemaker/blog/2008/07/video-growl-integration/


Thanks for that!


Note by Adam: However that custom function needs to be modified a little bit, as it doesn't checks for the GrowlHelper app running, be sure to change that!






Please also visit our site, http://crm.fm which has our main FileMaker product. Thanks!

The material on this document is offered as is. There is no representation or warranty, expressed or implied, nor does any other contributor to this post. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.




2 comments:

  1. Here is a custom function that does a similar thing:

    http://www.briandunning.com/cf/1064

    Based on ideas and code from Michael Gaslowitz http://www.gaslowitz.net/filemaker/blog/2008/07/video-growl-integration/

    ReplyDelete
  2. Thanks, I updated the post with your link!

    ReplyDelete