Monday, August 25, 2014

Quick tip: Detect OS X Yosemite dark mode from FileMaker

How to detect if OS X Yosemite is in "Dark Mode" from FileMaker?

Dark mode is stored in a defaults entry:  AppleInterfaceStyle
It's either "Dark" or no value.

So we just basically check if we get an error if we try to read this value.
If we get a value, we are in "Dark mode", else we're using "Normal mode".

Basic steps:

If [Abs (Get(SystemPlatform)) = 1]   //Running on OS X
    Perform AppleScript["do shell script "defaults read -g AppleInterfaceStyle""]  -  Native
      If [Get(LastError) = 0]
        Show Custom Dialog ["Dark mode!"]
      Else
        Show Custom Dialog["Normal mode!"]
      End if
End if

That's all.
You may use this to switch to a different themed layout, or to change your background color.

Thursday, October 21, 2010

iDeal CRM 6.0 has been released!!

I know, no updates on this site recently...

The main reason for that is that we were very busy finishing our CRM software.
I have already posted many FM techniques that came during the development of this product.
Still there are many left, so there will be new technical articles soon.



Sample videos:

1) Email import

2) Calendar


You can download our iDeal CRM here.



Saturday, August 7, 2010

FileMaker- Quick OS X Address Book importing without plugins

In this article I will show you how to import your OS X Address Book contacts quickly without plugins.

When it comes to Address Book, developers usually choose two methods.
1) AppleScript looping- It's slow for many contacts.
2) Plugins- They are not free.

I'd like to share another method, which is basically 2-3 lines of code.

What you will need:

1, perform applescript command
2, one import command
3, sql knowledge

How?

Address Book stores its data in an sqlite database, which can be found at the $Home/Library/Application Support/Address Book folder.

OS X can access this using the built-in sqlite3 command. (Reference here).

With this sqlite3, we just simply execute an sql command to get the address book data exported to a tab separated file to a temporary path (Perform Applescript- Do shell script)
Then we'll just import is using the Import Records script step.
(See the attached demo file for working scripts)

SQL:
You have to build your own SQL commands to use this technique. There are many GUI SQLite browsers (even Firefox plugins!). Browse through the address book tables, and explore them. That's exactly what I did.
Also you can do a search on "OS X address book sqlite" to find sample sql scripts to experiment with.

I attached a sample file which has two sample scripts.
The first script imports just the first name, last name, middle name, company data.
The second one imports the contact's phone number, mobile and email address as well.



You can download a really simple demonstration from here . (right click- save as).
Feel free to modify the scripts, sql statements!


Note: I didn't spend much time to optimize the code. You should quit Address Book before exporting it's data. If you experiment with this technique, please do a backup of your address book db.

The attached sample may need to be modified if your address book database file is somewhere else.


- Adam


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.

Friday, June 18, 2010

Multilingual FileMaker Layouts

In this article I will show you how to build a multilingual user interface in FileMaker.


Recently I saw a very complicated method floating around the net, so I thought I'd show you a method we use at Idealisator Hungary.

What you will need:

A table (called languages), which will hold the translations of every single layout text, button text, etc that you wish to use. These each will be new fields (eg: Button_OK, Button_Cancel, Message_Error, etc) + here you will have a text field (Language) which will contain the language name.

Get the idea? To create a new language you just need to create a new record in this language table, fill the Language field with the appropriate language name, fill the layout text fields, and there you have a new language.


Then you will need a CurrentLanguage Global field in the table your current layout is based on.
Then you just simply create a relation between this CurrentLanguage field with the Languages::Language text field, and you're pretty much ready.



You just need to add these fields to the layout (via the Language relations), and by changing the CurrentLanguage global field, you can easily change the display language on the layout.


You can download a really simple demonstration from here . (right click- save as).
I included english, german and hungarian languages.

Feel free to contact us if you need further information!

Update: In find mode, you need global fields for each layout text you use on the layout. (copy to those globals the appropriate language fields, or evaluate it.
As a solution should contain one, or maybe two search screens, not every layout searchable, I think it can be handled this way. In the comments you can see more of this. My opinion is that this method I wrote is one of the easiest to implement, while others may need much more work. - Adam


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.

Thursday, May 13, 2010

Simple logical board game in FileMaker

In this article I will show you a simple logical board game I created in FileMaker.

It's actually quite simple to implement, so I think beginners will like to investigate this unlocked solution and create their owns based on it.

The game has 4x4 cells, filled with numbers. There is an empty one which is the "gap".
You can only move the cells that are next to the gap.
(3, 15 and 9 can be moved in the picture above)

The goal is to reorder the numbers, so that they are in order, and the gap is in the lower right corner:
The board itself is a repeating field (16 repetitions), the clicking is done by an OnObjectEnter trigger attached to it (So it needs FM10- but can be modified to be FM8+ compatible by creating hidden buttons behind the repetitions).

After the click, we check if it is legal to move that piece (this is done by the "Move" script, the script parameter is the current repetition number).
If it's legal, we change the empty(gap) repetition with the clicked one, and store the empty cell's repetition number in a global variable ($$emptypiece).

After every legal movement we check if the user won the game (CheckWin script - It is just checking the repetitions with a loop).

Shuffling is done by imitating clicking at a random cell many times (500). This is important, because if we just initialized the repeating field with a random order, you may not be able to solve the game (!).

So shuffling with valid movements make sure the shuffled game can be solved.

The rest of the methods are easy to understand, check it out, you will see what they do exactly.

This is a FM10+ demo, which you can download from here . (right click- save as)

My other FileMaker based games (unlocked) can be found here:


Feel free to contact me if you need further information!

UPDATE:

I really got addicted to this :) So I modified it a little. Now it has colors, with conditional formatting (for the white gap). I also added keyboard navigation + a movement count to track our progress :)


Keyboard navigation is done by a Layout trigger (FM10+ - KeyboardMovement Script), colors are simple formatting (fill, but added a conditional formatting for the gap - white). Movement count is a simple new Number field.

So here it is, second version, you can download from here.


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.

Thursday, March 18, 2010

Save to PDF in Filemaker Runtimes? - Yes

I needed to export a report to PDF in one of our runtime solutions.

As we all know, it's not possible in FileMaker as PDF export script steps won't run in runtime solutions.

But I created a little workaround I'd like to share.

So what you need:

A global container field.

That's all.

1) When you do the report - enter preview mode on the report layout(be sure to set the page setup, etc).
2) Copy script step - Copy script step in preview mode copies the report to the clipboard(screenshot like)
3) Enter browse mode - go to the layout where you have that global field
4) Paste the clipboard to that global container field
5) Export field contents (the global container field).

Hey, there you have the pdf file from the runtime! Cool?

Note: It's basically for one page reports, but you can create a screen shot of every page of the report to a different container field (go to record-next in preview) and export those too.

I attached a sample file, which you can download here. You can create a runtime solution from it using FileMaker Pro Advanced.



Please visit our site, http://crm.fm which has our main FileMaker product, and support us by buying it. 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.

Monday, January 11, 2010

Tweet with FileMaker (simple method, Win+Mac, No Curl)

In the following article, I would like to demonstrate how you can update your twitter status with filemaker using a very simple method.

Recently I see a solution floating around which uses CURL to do this, but it's Mac only, and why use curl, if we don't need it?

We'll just use a simple web viewer to do this.

First we need to understand how we can update our status using twitter API. You can check this here.

If we have this, we just need to create a web viewer, with a post html form, and a so called "self-posting" javascript code in it.

This is it:

"data:text/html," &
"<html>
<head>
<script>
function PostMe() {document.getElementById(\"myform\").submit();}
</script>
</head>
<body onload=\"PostMe()\">
<form id=\"myform\" method=\"post\" action=\"http://" & FmPostTwit::UserName_Global & ":" & FmPostTwit::PassWord_Global & "@twitter.com/statuses/update.xml\" enctype=\"application/x-www-form-urlencoded;charset=utf-8\" accept-charset=\"UTF-8\">
<input type=\"hidden\" name=\"status\" value=\"" & FmPostTwit::Status_Global & "\">
</form>
</body>
</html>"



Let's take a look at it.

The "data:text/html," part is to let the web viewer have inner html content(the form).

The next part is the javascript code, which will post the form when it loads.

The last part is the html form, with the needed input (status- hidden).


This will be put into a web viewer(object name vw) by the Set Web Viewer Script step- Go To URL.


So basically the one line code is:


Set Web Viewer[Object Name:vw; URL: here comes the html code from above]


That's all.


I attached a sample file, which you can download here.


Please check it, and use this technique it if you like it.


Please visit our site, http://crm.fm which has our main FileMaker product, and support us by buying it. 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.

Sunday, January 10, 2010

Importing Twitter Friend Timeline into FileMaker

In the following article, I would like to demonstrate how you can use the twitter api to import your friends' timeline into FileMaker. We will come up with something like this:


We're going to use XML importing for this.
The fields we need in the database:

id
screen_name
text
profile_image_url (just for fun)


If you're not familiar with twitter api, and the xml it gives back please check this page first:

So, we can get the timeline xml with the following url:

http://username:password@twitter.com/statuses/friends_timeline.xml


(where of cource username is your twitter username and the password is your twitter password)

You can set other parameters as well (for example count: http://username:password@twitter.com/statuses/friends_timeline.xml?count=50 if you want the last 50 tweets)

But FileMaker cannot handle this xml yet.

We need an XSL file to convert it to a format that FileMaker can understant. It's a quite simple XSL I came up with. You can download it from here. (Be sure to download the file, not open it (right click- Save as - twitter2fmp.xsl)

We need to save this file somewhere, or upload it to a webserver. I chose the second method.

Now we can do the import script. It's quite simple as well, just one script step:

Import Records [No Dialog; http://username:password@twitter.com/statuses/friends_timeline.xml?count=50;http://website.com/twitter2fmp.xsl; Update matching; Mac Roman]

That's all.
The update matching is to ensure that no duplicate tweet is put into the tweets table.

Now you can create a simple list layout, or create a portal if you wish to display the the results.

I attached a sample file, which you can download here.
Please check it, and use this technique it if you like it.

Don't forget to fill your username and password!



Please visit our site, http://crm.fm which has our main FileMaker product, and support us by buying it. 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.

Friday, December 18, 2009

FileMaker 8+ gradient progress bar with one field - without containers


In the following article I will share a technique that I implemented in our current development, which needed FM8 techniques, as our client currently uses that.

I needed a progress bar, which looks great to show a script progress on a found set.

I didn't want to use containers and started thinking about how I would be able to create the progress bar without them.

Here's what I came up with:



The progress bar is a simple repeating field calculation(text) with 100 repetitions.

It uses the following calculation:

Let ( [r1=123;g1=80;b1=200;r2=10;g2=180;b2=50] ;

If ( Truncate ( (Get(RecordNumber)/Get(FoundCount)) * 100 ; 0) ≥ Get ( CalculationRepetitionNumber );


TextColor ( "█" ;RGB(


r1 + Floor((Get ( CalculationRepetitionNumber ) * (r2 - r1) / 100));

g1 + Floor((Get ( CalculationRepetitionNumber ) * (g2 - g1) / 100));

b1 + Floor((Get ( CalculationRepetitionNumber ) * (b2 - b1) / 100))


)


);""))


The first part of it is a LET calculation where I set up the beginning and the ending RGB colors, which will be used to calculate the actual repetition font color. The second part is a percentage calculator based on the current record and the found set.
The last part is used to calculate the actual RGB color.

The layout is simple, I just added the 100 repetitions, resized it, and set the font size to 72 points. I also added a fill color to the containers, that is what you can see under the gradient bar.

By modifying the rgb values you can come up with any color gradient you like:


I attached a sample file where you can find the calculation, investigate it, etc.

You can download it here.

Please check the demo file, and use this technique it if you like it.


Please visit our site, http://crm.fm which has our main FileMaker product, and support us by buying it. 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.

Sunday, December 6, 2009

Moving in your previous FileMaker found sets

In the following article I will share a technique that I implemented in our CRM system quite long time ago. It's about getting back to your previous found sets.


The main part of most business softwares is the Search part, by which you can create complex search requests (extending existing lists, constraining, etc).

The main problem is that once you did a search and got a search result, you cannot get back to your previous list, or the one before that one, etc.

We faced this problem, and tried to implement a method by which you can move back and forward in your previous 5 (can be increased... see below) found sets.

FileMaker makes this quite easy, as a new table occurrence of the same table can hold a different found set!

So here is the technique. (Be sure to download the demo file I attached, so the you can understand this!)

You need to create five(or as many found sets you want to keep) table occurrence of your result table. In the example I attached It's the clients table.


So I created Clients_1, Clients_2, Clients_3, Clients_4, Clients_5 table occurrences in the relational graph and created 5 empty layouts with the same name (the source table of them was the appropriate table occurrence!).


Then I created two global fields, ( CurrentFoundSet_Global- This one is to know which found set we are currently on, and TotalFoundSet_Global- This one holds how many founds sets have been saved already).

The next step is the [SRTN]- SaveFoundSet script, which saves the current found set to the appropriate place, and checks if we have reached the highest value we can keep. If we did then it shifts the found sets left, so we loose the very first one.

This is done by the Go To Related Record script step on the appropriate layouts.

The [SRTN] - RestoreFoundSet script is to restore a found set.

There are two other scripts which are attached to the Restore Previous and Restore next buttons. (RestorePrevious,RestoreNext).

The saving happens at the search layout, in the [PANE]- Main bar script.

I attached a sample file where you can find these scripts, you can download it here.

Here is how you can try this:

1) Click on the Search Pane
2) Enter a "a" in the FirstName field, then press Enter
3) Go to the Search Pane again
4) Enter a "b" in the FirstName field, press enter
5) Go to the Seach Pane again
6) Enter a "c" in the FirstName, press enter
7) Now you can navigate backward in you found sets, and see the results.

This can be improved, modified, just wanted to share the basic idea of this thing. Please check the demo file, and use this technique it if you like it.


Note: In the sample file I used Brian Dunning's sample data file.
Note2: The original idea came from this article by Danny Dawson, worth reading!

Please visit our site, http://crm.fm which has our main FileMaker product, and support us by buying it. 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.

Saturday, December 5, 2009

QuickTip: Creating a drop down list from an unstored calculation

The following technique is a quick tip, which may be known by some, but I needed it so many times in our current development that I thought I would share it.

If you have ever tried to create a value list from an unstored field, you may have noticed the following error message that filemaker gives you:


This means that our value list based on this calculation won't work.

What can we do now? Don't give up!

It's really simple.

If you have an ID field in your table (auto enter, serial), create a relation based on this field to itself like this:

(ID=ID)
The next thing to do is to modify the value list, so that it only includes values from this relation:

If you press OK now, you will still see the error message appear, but the value list will work now.


Please visit our site, http://crm.fm which has our main FileMaker product, and support us by buying it. 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.

Tuesday, December 1, 2009

Speeding up related record creation with importing

The following technique can be used when you have to create related records on a huge found set.

What is the main problem?

FileMaker can be really slow when you manually create many related records using a script, and we faced this when we developed our mass action (bulk mailing, exporting) part of our FileMaker based CRM. (Note: in our CRM there are two other related tables in which we needed related record creation which made things much worse)

Let's say you have client table, which has about 100.000 records. You also have a related table called History, which is to hold the events that happened to the clients.
If you try to add a history record to all clients in the found set, you'll have a script like this:

Freeze window
Go to Layout[Clients]
Go to Record/Request/Page[First]
Loop
Set Variable[$clientid;Clients::ClientID]
Go to Layout[History]
New record/request
Set Field[History::ClientID;$clientid]
Set Field[History::Event;"Client exported by user"]
Go to Layout[Clients]
Go to record/request/page [next, exit after last]
End Loop

It's an easy related record adder script which adds a "Client exported by user" text to the History table(it's related to the Clients table).

This would work well on small found sets. But when you try this on a big found set, you'll find yourself waiting for ages (and things get worse if we speak about a shared database and online usage).

How could it be sped up?

This is where exporting and importing can be a good solution, as you may noticed these functions create records much much faster.

This is how our script should be modified:

We'll need a global text field at the Clients table, where we set the "Client exported by user" text, let's call this Event_Global.

Now we can do an export on the clients table (we only need ClientID, and the Event_Global) to a temp directory in FP7 format.
After this we go to the History layout (and also table) and import that exported file as the following:

Clients::ClientID to History::ClientID
Clients::Event_Global to History::Event

And we're done.

So the modified script is the following:

Freeze Window
Set Field[Clients::Event_Global;"Client exported by user" ]
Set Variable [$path; Get(TemporaryPath) & "export.fp7"]
Export Records[No dialog; "$path"] //Note: here you need to add field Event_Global and ClientID
Go to Layout[History]
Import Records[No dialog;"$path";Add;Mac Roman]
Go to Layout[Original Layout]

And that's all.
So first we set the global field, then generate a path using Get(TemporaryPath) and save it to the $path variable.
Then we export the fields, go to the History layout and import it into the history fields.

Note: You need to be sure to set up both the export and import orders correctly!
Note2: Do not store sensitive data in temporary files, or if you have to make sure you delete it immediately after the script has finished!


Please visit our site, http://crm.fm which has our main FileMaker product, and support us by buying it. 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.

Monday, November 30, 2009

FileMaker Flot Chart (offline charts without plugins)


When it comes to FileMaker charting, developers usually start thinking about plugins, or online web viewer (for example: Google Chart API) solutions.

In the following example I show you how you can create an offline chart in FileMaker which looks great.


I came across Flot when I was looking for javascript graph solutions, and I really liked it.
Though I will use this. You can download the source of it, which has great example files as well.

The FileMaker integration is quite simple. We'll need a field, which holds the Javascript files. (I copied the jquery.flot.min.js, jquery.min.js and the excanvas.min.js script after each other into a field (in the example file attached it's called chartsource.

Then using this, and the field data, I created a web viewer which will display those fields to me.

The example file only shows the basics of creating an offline graph, it's up to you to look at Flot documentation and create different kind of graphs.

The demo file can be downloaded from here .

Please also visit our site, http://crm.fm which has our main FileMaker product, and support us by buying it. 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.

Thursday, November 26, 2009

FileMaker Multiple word(part) portal filter


This technique might be known by some, but I'm pretty sure that it isn't know by many.
What we want to create is a multiple word (or wordpart) portal filter.


Many single word FileMaker portal filter demonstrations can be found on the net, but currently I needed one that can filter by multiple words.

Here's how I did it.

First we need a searchfield on the layout. I called this SearchField_Display.
Then we need a custom function that can create the variations of our fields.

I chose AllTextCombination by Peter Gort (it can be seen here, at Brian Dunning's custom function library).

With this function we create an AllVariation field based on our fields:

AllTextCombinations ( FirstName ) &"¶" & AllTextCombinations ( LastName ) & "¶" & AllTextC

ombinations ( City ) & "¶_ALL_"


The "¶_ALL_" at the end will be important later. That's used to show all the records is the searchfield is empty.


If we have this, we need three additional fields, which will help us to create a 3 word search ability. (note: if you want four words, then you'll need four, but I think 3 must be enough).


I call them SearchField1, SearchField2 and SearchField3, and they are unstored text calculations:


SearchField1:

Let ( s = Substitute ( SearchField_Display ; "-" ; " " ) ;If ( IsEmpty(s) or IsEmpty(MiddleWords(s;1;1)) ;"_ALL_";MiddleWords(s;1;1) ))


SearchField2:

Let ( s = Substitute ( SearchField_Display ; "-" ; " " ) ;If ( IsEmpty(s) or IsEmpty(MiddleWords(s;2;1)) ;"_ALL_";MiddleWords(s;2;1) ))


SearchField3:

Let ( s = Substitute ( SearchField_Display ; "-" ; " " ) ;If ( IsEmpty(s) or IsEmpty(MiddleWords(s;3;1)) ;"_ALL_";MiddleWords(s;3;1) ))


As you may notice the only difference is the word which we get from them.

I also used a Substitute ("-" to a Space char) as my data contained many "-" chars, and I wanted them as different words).


By these we can create a relation to AllVariation:



As you can see we'll have 3 criterias. (If you want 4 word you'll need 4).


After this, if we use the portal filter we'll be able to search for things like: "we la c", or "an li v" or "Bil bar abi" so basically any part of our fields.

I attached a demo file which you can download from here . (right click- save as).


Note1:The demo uses Brian Dunning's sample data database which I downloaded from here.
Note2: I used many fields in the AllVariation field which makes the index huge. You shouldn't need to do that!

Please also visit our site, http://crm.fm which has our main FileMaker product, and support us by buying it. 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.






FileMaker Snake game - a FM 10 Demonstration



When I first started looking at FM10's new functions (Trigger, timer, etc), I wanted to create a demo, in which I can implement almost all of these new features.

I was currently also looking at my old floppy disks, and found my snake game I wrote in Turbo Pascal when I was a small kid, and thought why not recreate it in FileMaker?

It could demonstrate layout triggers (OnLayoutKeyStroke), Timers (speed of the game)
.

Heres is what I came up with:



The main layout is a repeating field container (300 repetitions actually), arranged.
The repeating field uses a global variable and conditional formatting to show the snake and the treasure (which is set by a custom function based on it's current repetition number).
Two colors are used, Green and White:


The Snake and Treasure positions are stored in global variables as a list (eg.: 10,12 11,12, etc), and are processed by the script.

The script names of the demo file shows what they do exactly, you could easily figure them out.

The layout has a script trigger, which is to check for keyboard input, so we can move the snake.

This is a FM10 demo, which you can download from here . (right click- save as)

Note1: I did't spend too much time on optimizing this, making it prettier, etc, it's up to you. This is just a demo file, to demonstrate some of FileMaker 10's new features.

Note2: Please also visit our site, http://crm.fm which has our main FileMaker product, and support us by buying it. 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.

Tuesday, November 24, 2009

Filemaker MineSweeper clone


Though about creating a board game in FileMaker to demonstrate the capabilities of FileMaker Pro.
Started it, finished in about 2 hours.


So here it is, actually it's pretty straight forward and fully unlocked so you can check it.

The main fields of the database are the Display, and the Game Repeating field.
The Display shows the board, while the Game contains the yet unrevealed fields, mines.

The Init method initializes the board, sets the random mines, counts the neighbor cells (how many one mine has), etc.
The ClickHandler method takes care of the clicks, by using hidden clickable layout elements behind the repeating fields.
(Actually these clickable elements weren't created by me one by one, setting up different script paramters 300 times, instead I created a script to generate the appropriate XML for me, and then pasted it on the layout using
Clip Manager 3 by MyFmButler. (Maybe I will show this technique in a separate article later if you're interested).

The rest of the methods are a bit harder to understand, but if you check them I'm pretty sure you will see how they're working.

This is a FM8+ demo, which you can download from here . (right click- save as)

Note1: I did't spend too much time on optimizing this. I'm pretty sure scripts could be more optimized, etc. This is just a demo file, to see how much you can do with Filemaker

Note2: Please also visit our site, http://crm.fm which has our main FileMaker product, and support us by buying it. 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.


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.