tag:blogger.com,1999:blog-3226145453609742502024-03-12T19:23:16.319-07:00Interesting FileMaker techniquesFileMaker techniques from a full-time FileMaker developer.
http://crm.fmAdam Vargahttp://www.blogger.com/profile/12064907555672929238noreply@blogger.comBlogger19125tag:blogger.com,1999:blog-322614545360974250.post-18863485581485117702014-08-25T11:34:00.000-07:002014-08-25T11:44:14.165-07:00Quick tip: Detect OS X Yosemite dark mode from FileMakerHow to detect if OS X Yosemite is in "Dark Mode" from FileMaker?<br />
<br />
Dark mode is stored in a defaults entry: AppleInterfaceStyle<br />
It's either "Dark" or no value.<br />
<br />
So we just basically check if we get an error if we try to read this value.<br />
If we get a value, we are in "Dark mode", else we're using "Normal mode".<br />
<br />
Basic steps:<br />
<br />
If [Abs (Get(SystemPlatform)) = 1] //Running on OS X<br />
Perform AppleScript["do shell script "defaults read -g AppleInterfaceStyle""] - Native<br />
If [Get(LastError) = 0]<br />
Show Custom Dialog ["Dark mode!"]<br />
Else<br />
Show Custom Dialog["Normal mode!"]<br />
End if<br />
End if<br />
<br />
That's all.<br />
You may use this to switch to a different themed layout, or to change your background color.<br />
<br />Adam Vargahttp://www.blogger.com/profile/12064907555672929238noreply@blogger.com5tag:blogger.com,1999:blog-322614545360974250.post-18831337938754515732010-10-21T03:35:00.000-07:002010-10-29T00:38:44.931-07:00iDeal CRM 6.0 has been released!!<div style="text-align: left;">I know, no updates on this site recently...</div><div><br /><div>The main reason for that is that we were very busy finishing our CRM software.</div><div>I have already posted many FM techniques that came during the development of this product.</div><div>Still there are many left, so there will be new technical articles soon.</div><div><br /></div><div><br /></div><div><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 310px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5OOJhwAQ6v6EKm3xy6XbGOuxQEU_3_f6i6dvbFlpTMnDa1hh_qbmRle-t3VAVT-WRvBo1Lhl2NJVFwRH75VNYx3I8wjuWgSO9XckpwFkEZjta0PPX9JfOTw29HtBI0YzxAWyjD4ZtLPw/s400/screen_2.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5533368251177684978" /></div><div><br /></div><div>Sample videos:</div><div><br /></div><div>1) Email import</div><div><iframe src="http://player.vimeo.com/video/16305904" width="400" height="300" frameborder="0"></iframe><p>2) Calendar</p><iframe src="http://player.vimeo.com/video/16087045" width="400" height="300" frameborder="0"></iframe><p><br /></p><p>You can download our iDeal CRM <a href="http://www.crm.fm/download">here</a>.</p></div><div><br /></div><div><br /></div></div>Adam Vargahttp://www.blogger.com/profile/12064907555672929238noreply@blogger.com2tag:blogger.com,1999:blog-322614545360974250.post-84485101882931582522010-08-07T04:18:00.000-07:002010-08-07T08:33:26.050-07:00FileMaker- Quick OS X Address Book importing without plugins<div style="text-align: left;">In this article I will show you how to import your OS X Address Book contacts quickly without plugins.</div><div style="text-align: left;"><br /></div><div style="text-align: left;">When it comes to Address Book, developers usually choose two methods. </div><div style="text-align: left;">1) AppleScript looping- It's slow for many contacts.</div><div style="text-align: left;">2) Plugins- They are not free.</div><div style="text-align: left;"><br /></div><div style="text-align: left;">I'd like to share another method, which is basically 2-3 lines of code.</div><div style="text-align: left;"><br /></div><div style="text-align: left;">What you will need:</div><div style="text-align: left;"><br /></div><div style="text-align: left;">1, perform applescript command</div><div style="text-align: left;">2, one import command</div><div style="text-align: left;">3, sql knowledge</div><div style="text-align: left;"><br /></div><div style="text-align: left;">How?</div><div style="text-align: left;"><br /></div><div style="text-align: left;">Address Book stores its data in an sqlite database, which can be found at the $Home/Library/Application Support/Address Book folder.</div><div style="text-align: left;"><br /></div><div style="text-align: left;">OS X can access this using the built-in sqlite3 command. (<a href="http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/sqlite3.1.html">Reference here</a>).</div><div style="text-align: left;"><br /></div><div style="text-align: left;">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)</div><div style="text-align: left;">Then we'll just import is using the Import Records script step.</div><div style="text-align: left;">(See the attached demo file for working scripts)</div><div style="text-align: left;"><br /></div><div style="text-align: left;">SQL:</div><div style="text-align: left;">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.</div><div style="text-align: left;">Also you can do a search on "OS X address book sqlite" to find sample sql scripts to experiment with.</div><div style="text-align: left;"><br /></div><div style="text-align: left;">I attached a sample file which has two sample scripts.</div><div style="text-align: left;">The first script imports just the first name, last name, middle name, company data.</div><div style="text-align: left;">The second one imports the contact's phone number, mobile and email address as well.</div><div style="text-align: left;"><br /></div><div style="text-align: left;"><br /></div><div><div style="text-align: left;"><br /></div></div><div><div><div><span class="Apple-style-span" style="font-size:small;">You can download a really simple demonstration from <a href="http://crm.fm/downloads/AddressBookImport.zip">here</a> . (right click- save as).</span></div><div>Feel free to modify the scripts, sql statements!</div><div><br /></div><div><br /></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 153);">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.</span></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 153);"><br /></span></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 153);">The attached sample may need to be modified if your address book database file is somewhere else.</span></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 153);"><br /></span></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 153);"><br /></span></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 153);"></span><span class="Apple-style-span" style="color: rgb(0, 0, 153);">- Adam</span></div><div><br /></div><div><br /></div><div><span class="Apple-style-span" style="font-size:small;"><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); line-height: 18px;"><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:small;"><b>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.</b></span></span></span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); line-height: 18px;"><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:small;"><b><br /></b></span></span></span></div></span></div></div></div>Adam Vargahttp://www.blogger.com/profile/12064907555672929238noreply@blogger.com24tag:blogger.com,1999:blog-322614545360974250.post-20034843317625802502010-06-18T13:44:00.000-07:002010-06-20T08:56:21.695-07:00Multilingual FileMaker Layouts<div style="text-align: left;">In this article I will show you how to build a multilingual user interface in FileMaker.</div><div style="text-align: left; "><br /></div><div><div style="text-align: left; "><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 165px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitjrXgpnzXgA1um1Z0_KHdLtjdrXfMdipAZGUmQcrOddpKcL1cdnKvh3gNiG6Misb481u0pzbrBAzUSy5uQsnuMzsbxG4lg9hE8P6vbm7t5w1bQaQk0gAO5AfiMrdMt4Jj1ZsC30aw-5g/s400/Screen+shot+2010-06-18+at+22.58.18.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5484220881480836466" /></div></div><div style="text-align: left; "><br /></div><div>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.</div><div><br /></div><div>What you will need:</div><div><br /></div><div>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.</div><div><br /></div><div>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.</div><div><br /></div><div><br /></div><div>Then you will need a CurrentLanguage Global field in the table your current layout is based on.</div><div>Then you just simply create a relation between this CurrentLanguage field with the Languages::Language text field, and you're pretty much ready.</div><div><br /></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsNL2ATsjj12l-1M2pyf_kHAQZ54gtUdQhA9-DsCD_IYAaXPwrmVIw6UhEx7QwsTGt8pShwx8Sa_qdSUFAEbm7JixBaz6PsC26SSJNF04DrCa9Kdza9sVckPYYVyXpQt1RrWA-hQuzHOY/s400/Screen+shot+2010-06-18+at+22.53.40.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5484221040947207970" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 302px; " /></span></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "><br /></span></div><div><br /></div><div>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.</div><div><br /></div><div><br /></div><div><div><div><span class="Apple-style-span" style="font-size:small;">You can download a really simple demonstration from <a href="http://crm.fm/downloads/LanguageChanger.zip">here</a> . (right click- save as).</span></div><div><span class="Apple-style-span" style="font-size:small;">I included english, german and hungarian languages.</span></div><div><br /></div><div>Feel free to contact us if you need further information!</div><div><br /></div><div><span class="Apple-style-span" style="color:#000099;">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.</span></div><div><span class="Apple-style-span" style="color:#000099;">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</span></div><div><br /></div><div><br /></div><div><span class="Apple-style-span" style="font-size:small;"><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); line-height: 18px; "><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:small;"><b>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.</b></span></span></span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); line-height: 18px; "><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:small;"><b><br /></b></span></span></span></div></span></div></div></div>Adam Vargahttp://www.blogger.com/profile/12064907555672929238noreply@blogger.com10tag:blogger.com,1999:blog-322614545360974250.post-76237807870962531762010-05-13T09:29:00.001-07:002010-05-14T08:03:17.872-07:00Simple logical board game in FileMaker<div style="text-align: left;">In this article I will show you a simple logical board game I created in FileMaker.</div><div><div style="text-align: left;"><br /></div></div><div>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.</div><div style="text-align: center;"><br /></div><div><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 198px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuLFArooBGbD5zjnj0Ua2ScbDTMIUgFWcnN_jeevoHiVdPuYaKdUUUfTe-OZLa7QQx5Tlz2A-CqAX44A2joNecISA5CeNfjshppA_EmOQ09JrFxIqjGqYkT4vUKQGlcruyTyWgKpW6KqE/s400/tilitoli1.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5470793320750315570" /></div><div>The game has 4x4 cells, filled with numbers. There is an empty one which is the "gap".</div><div>You can only move the cells that are next to the gap. </div><div>(3, 15 and 9 can be moved in the picture above)</div><div><br /></div><div>The goal is to reorder the numbers, so that they are in order, and the gap is in the lower right corner:</div><div><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 198px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZJUiJOTGRU-eaPyhrVDcDhVozIliBJFsOuIUd0YukPRW8K6AEsInGUAZenmfZS0aKX9fcyqHQy3LC0pluXT5D796evTk2NOlP8tLnN6grzGChST_IpMShsg6l32P5n7sz5-eH2l1tIUs/s400/tilitoli2.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5470793951905350658" /></div><div>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).</div><div><br /></div><div>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).</div><div>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).</div><div><br /></div><div>After every legal movement we check if the user won the game (CheckWin script - It is just checking the repetitions with a loop).</div><div><br /></div><div>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 (!).</div><div><br /></div><div>So shuffling with valid movements make sure the shuffled game can be solved.</div><div><br /></div><div><div><div><span class="Apple-style-span" style="font-size:small;">The rest of the methods are easy to understand, check it out, you will see what they do exactly.</span></div><div><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div><span class="Apple-style-span" style="font-size:small;">This is a FM10+ demo, which you can download from <a href="http://crm.fm/downloads/TiliToli.zip">here</a> . (right click- save as)</span></div><div><br /></div><div>My other FileMaker based games (unlocked) can be found here:</div><div><br /></div><div><a href="http://fmtechniques.blogspot.com/2009/11/filemaker-minesweeper-clone.html">MineSweeper Clone</a></div><div><a href="http://fmtechniques.blogspot.com/2009/11/filemaker-snake-game-fm-10.html">Snake game</a></div><div><br /></div><div>Feel free to contact me if you need further information!</div><div><br /></div><div><b>UPDATE:</b></div><div><br /></div><div>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 :)</div><div><br /></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXcHyy3jjxn55ZlHR9Jso8jWi6P4ihXdYbx2bbJuWJojn8Y7TIUcynlXXA6hX_6YAWoTQ7jkl0S3f2YWJzPRiCVCqtUL_FFBsYlpCUy8XSJ4zei_NQPUtrafeUlI63fprN13KOlYuvNeY/s400/tilitoliv2.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5471140136894072642" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 198px; " /></span></div><div><br /></div><div>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.</div><div><br /></div><div>So here it is, second version, you can download from <a href="http://crm.fm/downloads/TiliToli2.zip">here</a>.</div><div><br /></div><div><br /></div><div><span class="Apple-style-span" style="font-size:small;"><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); line-height: 18px; "><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:small;"><b>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.</b></span></span></span></div><br /></span></div></div></div>Adam Vargahttp://www.blogger.com/profile/12064907555672929238noreply@blogger.com2tag:blogger.com,1999:blog-322614545360974250.post-51682482654601906832010-03-18T10:13:00.001-07:002010-03-18T10:34:57.999-07:00Save to PDF in Filemaker Runtimes? - Yes<div style="text-align: left; ">I needed to export a report to PDF in one of our runtime solutions.</div><div style="text-align: left; "><br /></div><div style="text-align: left; ">As we all know, it's not possible in FileMaker as PDF export script steps won't run in runtime solutions.</div><div style="text-align: left; "><br /></div><div style="text-align: left; ">But I created a little workaround I'd like to share.</div><div style="text-align: left; "><br /></div><div style="text-align: left; ">So what you need:</div><div style="text-align: left; "><br /></div><div style="text-align: left; ">A global container field. </div><div style="text-align: left; "><br /></div><div style="text-align: left; ">That's all.</div><div style="text-align: left; "><br /></div><div style="text-align: left; ">1) When you do the report - enter preview mode on the report layout(be sure to set the page setup, etc).</div><div style="text-align: left; ">2) Copy script step - Copy script step in preview mode copies the report to the clipboard(screenshot like)</div><div style="text-align: left; ">3) Enter browse mode - go to the layout where you have that global field</div><div style="text-align: left; ">4) Paste the clipboard to that global container field</div><div style="text-align: left; ">5) Export field contents (the global container field).</div><div style="text-align: left; "><br /></div><div style="text-align: left; ">Hey, there you have the pdf file from the runtime! Cool?</div><div style="text-align: left; "><br /></div><div style="text-align: left; ">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.</div><div style="text-align: left; "><br /></div><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal 'Lucida Grande'; "><span class="Apple-style-span" style="font-size:medium;">I attached a sample file, which you can download </span><span class="Apple-style-span" style="font-size:medium;"><a href="http://crm.fm/downloads/pdfexportrtime.zip">here</a></span><span class="Apple-style-span" style="font-size:medium;">. You can create a runtime solution from it using FileMaker Pro Advanced.</span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal 'Lucida Grande'; "><span class="Apple-style-span" style="font-size:medium;"><br /></span></p><div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><br /></span></div><div><div><span class="Apple-style-span" style="font-family:Helvetica, serif;"><div><b><span class="Apple-style-span" style="font-size:small;">Please visit our site, </span></b><a href="http://crm.fm/"><b><span class="Apple-style-span" style="font-size:small;">http://crm.fm</span></b></a><b><span class="Apple-style-span" style="font-size:small;"> which has our main FileMaker product, and support us by buying it. Thanks!</span></b></div><div><span class="Apple-style-span" style="font-size:small;"><div><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); line-height: 18px; "><span class="Apple-style-span" style="font-family:arial;"><b><span class="Apple-style-span" style="font-size:small;">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.</span></b></span></span></div></span></div></span></div></div></div>Adam Vargahttp://www.blogger.com/profile/12064907555672929238noreply@blogger.com3tag:blogger.com,1999:blog-322614545360974250.post-46002501218793468432010-01-11T02:11:00.001-08:002010-01-11T02:29:54.374-08:00Tweet with FileMaker (simple method, Win+Mac, No Curl)<div style="text-align: left; ">In the following article, I would like to demonstrate how you can update your twitter status with filemaker using a very simple method.</div><div style="text-align: left; "><br /></div><div style="text-align: left; ">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?</div><div style="text-align: left; "><br /></div><div style="text-align: left; ">We'll just use a simple web viewer to do this.</div><div style="text-align: left; "><br /></div><div style="text-align: left; ">First we need to understand how we can update our status using twitter API. You can check this <a href="http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses%C2%A0update">here</a>.</div><div style="text-align: left; "><br /></div><div style="text-align: left; ">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.</div><div style="text-align: left; "><br /></div><div style="text-align: left; ">This is it:</div><div style="text-align: left; "><br />"data:text/html," &<br />"<html><br /><head><br /><script><br /> function PostMe() {document.getElementById(\"myform\").submit();}<br /></script><br /></head><br /><body onload=\"PostMe()\"><br /><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\"><br /><input type=\"hidden\" name=\"status\" value=\"" & FmPostTwit::Status_Global & "\"><br /></form><br /></body><br /></html>"<br /><br /><br /></div><br /><pre><div style="text-align: left; "><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><span class="Apple-style-span" style="white-space: normal; ">Let's take a look at it.</span></p></div></pre><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><span class="Apple-style-span" style="font-size:small;">The "data:text/html," part is to let the web viewer have inner html content(the form).</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><span class="Apple-style-span" style="font-size:small;">The next part is the javascript code, which will post the form when it loads.</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><span class="Apple-style-span" style="font-size:small;">The last part is the html form, with the needed input (status- hidden).</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><span class="Apple-style-span" style="font-size:small;"><br /></span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><span class="Apple-style-span" style="font-size:small;">This will be put into a web viewer(object name vw) by the Set Web Viewer Script step- Go To URL.</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><span class="Apple-style-span" style="font-size:small;"><br /></span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><span class="Apple-style-span" style="font-size:small;">So basically the one line code is:</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><span class="Apple-style-span" style="font-size:small;"><br /></span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><span class="Apple-style-span" style="font-size:small;">Set Web Viewer[Object Name:vw; URL: here comes the html code from above]</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><span class="Apple-style-span" style="font-size:small;"><br /></span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><span class="Apple-style-span" style="font-size:small;">That's all.</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><span class="Apple-style-span" style="font-size: medium;">I attached a sample file, which you can download </span><a href="http://crm.fm/downloads/FmPostTwit.zip"><span class="Apple-style-span" style="font-size: medium;">here</span></a><span class="Apple-style-span" style="font-size: medium;">.</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><span class="Apple-style-span" style="font-size: medium;"><br /></span></p><div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size: small;">Please check it, and use this technique it if you like it.</span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><br /></span></div><div><div><span class="Apple-style-span" style="font-family:Helvetica, serif;"><div><b><span class="Apple-style-span" style="font-size:small;">Please visit our site, </span></b><a href="http://crm.fm/"><b><span class="Apple-style-span" style="font-size:small;">http://crm.fm</span></b></a><b><span class="Apple-style-span" style="font-size:small;"> which has our main FileMaker product, and support us by buying it. Thanks!</span></b></div><div><span class="Apple-style-span" style="font-size:small;"><div><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); line-height: 18px; "><span class="Apple-style-span" style="font-family:arial;"><b><span class="Apple-style-span" style="font-size:small;">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.</span></b></span></span></div></span></div></span></div></div></div>Adam Vargahttp://www.blogger.com/profile/12064907555672929238noreply@blogger.com10tag:blogger.com,1999:blog-322614545360974250.post-37147208931122944332010-01-10T04:46:00.000-08:002010-01-10T05:49:21.543-08:00Importing Twitter Friend Timeline into FileMaker<div style="text-align: left;"><span class="Apple-style-span" style="font-size:medium;">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:</span></div><div><span class="Apple-style-span" style="font-size:medium;"><br /></span></div><div><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 291px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1JZWFi8a4cEu112yKHciQ0KsSK8l9VEqatRov0-U5T2I_nYg4lzQLXaPchcRhtdwpHZcTwG13fJEp0ArZVulIg7GcMmLqIYZbaOGb3RA0rTaiNXKW08GnrZemIkOrVEspCwCK2ypfC9c/s400/twitfmp.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5425102551290375682" /></div><div><span class="Apple-style-span" style="font-size:medium;"><br /></span></div><div><span class="Apple-style-span" style="font-size:medium;">We're going to use XML importing for this.</span></div><div><span class="Apple-style-span" style=" ;font-size:medium;">The fields we need in the database:</span></div><div><span class="Apple-style-span" style="font-size:medium;"><br /></span></div><div><span class="Apple-style-span" style="font-size:medium;"><i>id</i></span></div><div><span class="Apple-style-span" style="font-size:medium;"><i>screen_name</i></span></div><div><span class="Apple-style-span" style="font-size:medium;"><i>text</i></span></div><div><span class="Apple-style-span" style="font-size:medium;"><i>profile_image_url (just for fun)</i></span></div><div><div style="text-align: left; "><span class="Apple-style-span" style="font-size:medium;"><br /></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-size:medium;"><br /></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-size:medium;">If you're not familiar with twitter api, and the xml it gives back please </span><span class="Apple-style-span" style="font-size:medium;"><a href="http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses-friends_timeline">check this page</a> first</span><span class="Apple-style-span" style="font-size:medium;">: </span></div><div style="text-align: center; "><span class="Apple-style-span" style="font-size:medium;"><br /></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-size:medium;">So, we can get the timeline xml with the following url:</span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-size:medium;"><br /></span></div><div style="text-align: left; "><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><span class="Apple-style-span" style="font-size:medium;"><i>http://username:password@twitter.com/statuses/friends_timeline.xml</i></span></p></div><div style="text-align: center; "><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-size:small;">(where of cource username is your twitter username and the password is your twitter password)</span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-size:medium;">You can set other parameters as well (for example count: </span><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:medium;">http://username:password@twitter.com/statuses/friends_timeline.xml?count=50 if you want the last 50 tweets)</span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-size:medium;">But FileMaker cannot handle this xml yet. </span></div><div style="text-align: left; "><br /></div><div style="text-align: left; ">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 <a href="http://www.crm.fm/downloads/twitter2fmp.xsl">here</a>. (<i><span class="Apple-style-span" style="font-size:small;">Be sure to download the file, not open it (right click- Save as - </span></i><span class="Apple-style-span" style=" font-weight: bold; font-size:small;"><i>twitter2fmp.xsl</i>)</span></div><div style="text-align: left; "><br /></div><div style="text-align: left; ">We need to save this file somewhere, or upload it to a webserver. I chose the second method.</div><div style="text-align: left; "><br /></div><div style="text-align: left; ">Now we can do the import script. It's quite simple as well, just one script step:</div><div style="text-align: left; "><br /></div><div style="text-align: left; "><span class="Apple-style-span" style="font-size:small;"><b>Import Records [No Dialog; http://username:password@twitter.com/statuses/friends_timeline.xml?count=50;http://website.com/twitter2fmp.xsl; Update matching; Mac Roman]</b></span></div><div style="text-align: left; "><div style="text-align: center; "><br /></div><div style="text-align: left;">That's all. </div><div style="text-align: left;">The update matching is to ensure that no duplicate tweet is put into the tweets table.</div><div style="text-align: left;"><br /></div><div style="text-align: left;">Now you can create a simple list layout, or create a portal if you wish to display the the results.</div><div style="text-align: center;"><br /></div></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:medium;">I attached a sample file, which you can download </span><a href="http://crm.fm/downloads/twitter2fmp.zip"><span class="Apple-style-span" style="font-size:medium;">here</span></a><span class="Apple-style-span" style="font-size:medium;">.</span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:medium;">Please check it, and use this technique it if you like it.</span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:medium;">Don't forget to fill your username and password!</span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><br /></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;"><br /></span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><br /></span></div><div><div><span class="Apple-style-span" style="font-family:Helvetica, serif;"><div><b><span class="Apple-style-span" style="font-size:small;">Please visit our site, </span></b><a href="http://crm.fm/"><b><span class="Apple-style-span" style="font-size:small;">http://crm.fm</span></b></a><b><span class="Apple-style-span" style="font-size:small;"> which has our main FileMaker product, and support us by buying it. Thanks!</span></b></div><div><span class="Apple-style-span" style="font-size:small;"><div><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); line-height: 18px; "><span class="Apple-style-span" style="font-family:arial;"><b><span class="Apple-style-span" style="font-size:small;">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.</span></b></span></span></div></span></div></span></div></div></div>Adam Vargahttp://www.blogger.com/profile/12064907555672929238noreply@blogger.com2tag:blogger.com,1999:blog-322614545360974250.post-10451793363792272722009-12-18T00:03:00.000-08:002010-01-04T01:04:54.895-08:00FileMaker 8+ gradient progress bar with one field - without containers<div style="text-align: center;"><br /></div><div style="text-align: left;">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.</div><div style="text-align: left; "><br /></div><div style="text-align: left; ">I needed a progress bar, which looks great to show a script progress on a found set.</div><div style="text-align: center;"><br /></div><div style="text-align: left; ">I didn't want to use containers and started thinking about how I would be able to create the progress bar without them.</div><div style="text-align: center;"><br /></div><div style="text-align: left; ">Here's what I came up with:</div><div style="text-align: left; "><br /></div><div style="text-align: left; "><div style="text-align: center;"><br /></div><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 219px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaXQug-L7PJyEOoO2H4iH0UTKi2I9qdDgMoI5EQBrqOizabKKb4b0PY6Fvy9a5yJ27f6pT3CTmKJ9Tn1aP5Y6FIeoWMgakOs3sPjEfvihyphenhyphenDVQSrptqd0RVY1TLlLvjoHOPkEl3LkjgIhE/s400/gradientprogressfm8.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5416484512014449346" /></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;"><br /></span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;">The progress bar is a simple repeating field calculation(text) with 100 repetitions.</span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><br /></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;">It uses the following calculation:</span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><br /></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'">Let ( [r1=123;g1=80;b1=200;r2=10;g2=180;b2=50] ;</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'">If ( Truncate ( (Get(RecordNumber)/Get(FoundCount)) * 100 ; 0) ≥ Get ( CalculationRepetitionNumber );</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'; min-height: 13.0px"><br /></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'">TextColor ( "█" ;RGB(</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'; min-height: 13.0px"><br /></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'">r1 + Floor((Get ( CalculationRepetitionNumber ) * (r2 - r1) / 100));</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'">g1 + Floor((Get ( CalculationRepetitionNumber ) * (g2 - g1) / 100));</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'">b1 + Floor((Get ( CalculationRepetitionNumber ) * (b2 - b1) / 100))</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'; min-height: 13.0px"><br /></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'">)</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'; min-height: 13.0px"><br /></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'">);""))</p></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><br /></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;">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. </span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;">The last part is used to calculate the actual RGB color.</span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><br /></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;">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.</span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><br /></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;">By modifying the rgb values you can come up with any color gradient you like:</span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><br /></span></div><div style="text-align: left; "><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtI05wJPdANbEDC0WLS6HAAvz6uwGziX19df5uy6sAZM2VjLiVQkocFcZ2dFUc26l9ruRZVqwngJwPhmlJmkVT47dj0YWdU28hHKQz3Lkt3udhzyJh643Tx3PxyyPEXLyi5DbTkxtnk64/s1600-h/rgbblackwhite.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 290px; height: 44px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtI05wJPdANbEDC0WLS6HAAvz6uwGziX19df5uy6sAZM2VjLiVQkocFcZ2dFUc26l9ruRZVqwngJwPhmlJmkVT47dj0YWdU28hHKQz3Lkt3udhzyJh643Tx3PxyyPEXLyi5DbTkxtnk64/s400/rgbblackwhite.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5416486894275963410" /></a></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><br /></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;">I attached a sample file where you can find the calculation, investigate it, etc.</span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><br /></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;">You can download it </span><span class="Apple-style-span" style="font-size:small;"><a href="http://crm.fm/downloads/GradientProgress.zip">here</a></span><span class="Apple-style-span" style="font-size:small;">.</span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;"><br /></span></span></div><div style="text-align: left; "><span class="Apple-style-span" style=" ;font-family:'Lucida Grande', serif;">Please check the demo file, and use this technique it if you like it.</span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;"><br /></span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><br /></span></div><div><div><span class="Apple-style-span" style="font-family:Helvetica, serif;"><div><b><span class="Apple-style-span" style="font-size:small;">Please visit our site, </span></b><a href="http://crm.fm/"><b><span class="Apple-style-span" style="font-size:small;">http://crm.fm</span></b></a><b><span class="Apple-style-span" style="font-size:small;"> which has our main FileMaker product, and support us by buying it. Thanks!</span></b></div><div><span class="Apple-style-span" style="font-size:small;"><div><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); line-height: 18px; "><span class="Apple-style-span" style="font-family:arial;"><b><span class="Apple-style-span" style="font-size:small;">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.</span></b></span></span></div></span></div></span></div></div>Adam Vargahttp://www.blogger.com/profile/12064907555672929238noreply@blogger.com3tag:blogger.com,1999:blog-322614545360974250.post-70010024435930406582009-12-06T11:55:00.000-08:002009-12-06T12:27:46.677-08:00Moving in your previous FileMaker found sets<div style="text-align: left;"><span class="Apple-style-span" style="font-size: small;">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.</span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div style="text-align: center;"><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-size:small;"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 304px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNN7VJO5r0ejjoF60C8ml9CzZE46kEks-WwyuFZ61VU31xjAMRAccYHyb3cfbiP3IMggcGBWLVbgBG6fQ-hJVgvJoOC67oMfmpPEErIeKjl3al_uZKcLMWy0lFrZBnyvwvkxMnI-7_6bY/s400/foundmovement.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5412220916935260482" /></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-size:small;">The main part of most business softwares is the Search part, by which you can create complex search requests (extending existing lists, constraining, etc).</span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-size:small;">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.</span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-size:small;">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.</span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-size:small;">FileMaker makes this quite easy, as a new table occurrence of the same table can hold a different found set!</span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-size:small;">So here is the technique. (Be sure to download the </span><a href="http://crm.fm/downloads/FoundSetMovement.zip"><span class="Apple-style-span" style="font-size:small;">demo file</span></a><span class="Apple-style-span" style="font-size:small;"> I attached, so the you can understand this!)</span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-size:small;">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.</span></div><div style="text-align: left; "><br /></div><div style="text-align: left; "><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 321px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiS9IaMaMeOsuGrFuXVIX1YJnDiZd1q3zRv-eqX7u5JzH_Jf8KAOsXgJWeUe1fsVoYch8GfZ2-voSfxdXMUDlKrXw05FYVQJQkrIHIWpoez1V9RImi78Q7mxtlon6fvZQU1PShdUWsnQY8/s400/tableocc.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5412221170348935378" /></div><div style="text-align: left; "><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-size:small;">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!).</span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-size:small;"><br /><div style="text-align: center;"><br /></div></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-size:small;">Then I created two global fields, ( </span><span class="Apple-style-span" style=" ;font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;">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).</span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;"><br /></span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;">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.</span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;"><br /></span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;">This is done by the Go To Related Record script step on the appropriate layouts.</span></span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA49F7UZdlG_FrEim0P0kabhXCLBDmmexMy7je4IzTIMp1xdaCOjKskmWb67Gf6ObA9FRTmm9DM6dULWQtoBF8ZvoDoGWCethPUQwDGNbEHqco7cI2Y1aFcHIEYTsmCHBsyzNTR-C_POY/s1600-h/savefoundset.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 236px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA49F7UZdlG_FrEim0P0kabhXCLBDmmexMy7je4IzTIMp1xdaCOjKskmWb67Gf6ObA9FRTmm9DM6dULWQtoBF8ZvoDoGWCethPUQwDGNbEHqco7cI2Y1aFcHIEYTsmCHBsyzNTR-C_POY/s400/savefoundset.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5412221989414660210" /></a></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;"><br /></span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;">The [SRTN] - RestoreFoundSet script is to restore a found set.</span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;"><br /></span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;">There are two other scripts which are attached to the Restore Previous and Restore next buttons. (RestorePrevious,RestoreNext).</span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;"><br /></span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;">The saving happens at the search layout, in the [PANE]- Main bar script.</span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;"><br /></span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;">I attached a sample file where you can find these scripts, you can download it </span><a href="http://crm.fm/downloads/FoundSetMovement.zip"><span class="Apple-style-span" style="font-size:small;">here</span></a><span class="Apple-style-span" style="font-size:small;">.</span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;"><br /></span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;">Here is how you can try this:</span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;"><br /></span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;">1) Click on the Search Pane</span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;">2) Enter a "a" in the FirstName field, then press Enter</span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;">3) Go to the Search Pane again</span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;">4) Enter a "b" in the FirstName field, press enter</span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;">5) Go to the Seach Pane again</span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;">6) Enter a "c" in the FirstName, press enter</span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;">7) Now you can navigate backward in you found sets, and see the results.</span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;"><br /></span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;">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.</span></span></div><div style="text-align: left; "><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;"><br /></span></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;"><br /></span></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;">Note: In the sample file I used Brian Dunning's </span><a href="http://www.briandunning.com/sample-data/"><span class="Apple-style-span" style="font-size:small;">sample data file</span></a><span class="Apple-style-span" style="font-size:small;">.</span></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;"><span class="Apple-style-span" style="font-size:small;">Note2: The original idea came from </span><a href="http://my.advisor.com/doc/18698"><span class="Apple-style-span" style="font-size:small;">this article by </span></a><span class="Apple-style-span" style="font-family:verdana, arial, helvetica, sans-serif;"><a href="http://my.advisor.com/doc/18698"><span class="Apple-style-span" style="font-size:small;">Danny Dawson</span></a></span><span class="Apple-style-span" style="font-size:small;">, worth reading!</span></span></div><div><div><span class="Apple-style-span" style="font-size:small;"><br /></span></div></div><div><div><span class="Apple-style-span" style="font-family:Helvetica, serif;"><div><b><span class="Apple-style-span" style="font-size:small;">Please visit our site, </span></b><a href="http://crm.fm/"><b><span class="Apple-style-span" style="font-size:small;">http://crm.fm</span></b></a><b><span class="Apple-style-span" style="font-size:small;"> which has our main FileMaker product, and support us by buying it. Thanks!</span></b></div><div><span class="Apple-style-span" style="font-size:small;"><div><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); line-height: 18px; "><span class="Apple-style-span" style="font-family:arial;"><b><span class="Apple-style-span" style="font-size:small;">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.</span></b></span></span></div></span></div></span></div></div>Adam Vargahttp://www.blogger.com/profile/12064907555672929238noreply@blogger.com0tag:blogger.com,1999:blog-322614545360974250.post-68210604054698575262009-12-05T04:06:00.000-08:002009-12-05T04:21:09.064-08:00QuickTip: Creating a drop down list from an unstored calculation<div style="text-align: left;">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.</div><div style="text-align: center;"><br /></div><div>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:</div><div><div style="text-align: center;"><br /></div><div style="text-align: center;"><br /></div><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 163px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsjJcF0Qc-ixKmdW5OKBLzg-iNTwOrEXyWom1UHdgfikFprJ-suPK6jJIlTPFVrBPGuDlUW0f7XnMBzLbsYZpLccdbyFUZA_YbqaNDZnOeRaRQyBedhJ99ySJ667U59mCg16zRBB9ND2U/s400/unstoredError.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5411723524520960210" /></div><div><div>This means that our value list based on this calculation won't work.</div><div style="text-align: center;"><br /></div><div>What can we do now? Don't give up!</div><div><br /></div><div>It's really simple.</div><div><br /></div><div>If you have an ID field in your table (auto enter, serial), create a relation based on this field to itself like this:</div><div style="text-align: center;"><br /></div><div><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 139px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkE2-8j31Qr2Et8IKUu_KYZeDnBqYb6EZ_SO3fcZopOG40aipoVcJ6RCtp_y5BrpK7Wapfn9Uymym0Qfq5cjrmoZ1oBLrQoWeB-1WlgksBUFF6pXktsDGXwELrXcUInbzbBDWtUP0DjRc/s400/selfrelation.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5411724732564495442" /></div><div style="text-align: center;">(ID=ID)</div><div>The next thing to do is to modify the value list, so that it only includes values from this relation:</div><div><br /></div><div><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 343px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivn0_Ebq7D8NF3Jlm2H1ATksHkRHzNMQxB919CLvVQBQ5BpDO2yBd0Ie3NjXmpVxej4qY1vprAsV8dR9j8jENHRFiZP1-EUHlpjglwU4aMnEICMa9ToFIEbLPzM3i2bQZGY-mltF836zM/s400/selfrelationValuelist.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5411725158584616482" /></div><div>If you press OK now, you will still see the error message appear, but the value list will work now.</div><div><br /></div><div><br /></div></div><div><div><span class="Apple-style-span" style="font-family:Helvetica, serif;"><div><b><span class="Apple-style-span" style="font-size:large;">Please visit our site, </span></b><a href="http://crm.fm/"><b><span class="Apple-style-span" style="font-size:large;">http://crm.fm</span></b></a><b><span class="Apple-style-span" style="font-size:large;"> which has our main FileMaker product, and support us by buying it. Thanks!</span></b></div><div><span class="Apple-style-span" style="font-size:small;"><div><br /></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); line-height: 18px; "><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:small;"><b>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.</b></span></span></span></div></span></div></span></div></div>Adam Vargahttp://www.blogger.com/profile/12064907555672929238noreply@blogger.com1tag:blogger.com,1999:blog-322614545360974250.post-56724437866121559972009-12-01T14:16:00.000-08:002009-12-01T14:52:08.581-08:00Speeding up related record creation with importing<div>The following technique can be used when you have to create related records on a huge found set.</div><div><br /></div><div>What is the main problem?</div><div><br /></div><div>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 <a href="http://crm.fm/">FileMaker based CRM</a>. (Note: in our CRM there are two other related tables in which we needed related record creation which made things much worse)</div><div><br /></div><div>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.</div><div>If you try to add a history record to all clients in the found set, you'll have a script like this:</div><div><br /></div><div><b><span class="Apple-style-span" style="font-size:small;">Freeze window</span></b></div><div><b><span class="Apple-style-span" style="font-size:small;">Go to Layout[Clients]</span></b></div><div><b><span class="Apple-style-span" style="font-size:small;">Go to Record/Request/Page[First]</span></b></div><div><b><span class="Apple-style-span" style="font-size:small;">Loop</span></b></div><div><b><span class="Apple-style-span" style="font-size:small;"> Set Variable[$clientid;Clients::ClientID]</span></b></div><div><b><span class="Apple-style-span" style="font-size:small;"> Go to Layout[History]</span></b></div><div><b><span class="Apple-style-span" style="font-size:small;"> New record/request</span></b></div><div><b><span class="Apple-style-span" style="font-size:small;"> Set Field[History::ClientID;$clientid]</span></b></div><div><b><span class="Apple-style-span" style="font-size:small;"> Set Field[History::Event;"Client exported by user"]</span></b></div><div><b><span class="Apple-style-span" style="font-size:small;"> Go to Layout[Clients]</span></b></div><div><b><span class="Apple-style-span" style="font-size:small;"> Go to record/request/page [next, exit after last]</span></b></div><div><b><span class="Apple-style-span" style="font-size:small;">End Loop</span></b></div><div><br /></div><div>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).</div><div><br /></div><div>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).</div><div><br /></div><div>How could it be sped up?</div><div><br /></div><div>This is where exporting and importing can be a good solution, as you may noticed these functions create records much much faster.</div><div><br /></div><div>This is how our script should be modified:</div><div><br /></div><div>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.</div><div><br /></div><div>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.</div><div>After this we go to the History layout (and also table) and import that exported file as the following:</div><div><br /></div><div>Clients::ClientID to History::ClientID</div><div>Clients::Event_Global to History::Event</div><div><br /></div><div>And we're done.</div><div><br /></div><div>So the modified script is the following:</div><div><br /></div><div><span class="Apple-style-span" style="font-size:small;"><b>Freeze Window</b></span></div><div><div><span class="Apple-style-span" style="font-size:small;"><b>Set Field[Clients::Event_Global;"Client exported by user" ]</b></span></div><div><span class="Apple-style-span" style="font-size:small;"><b>Set Variable [$path; Get(TemporaryPath) & "export.fp7"]</b></span></div><div><span class="Apple-style-span" style="font-size:small;"><b>Export Records[No dialog; "$path"] //Note: here you need to add field Event_Global and ClientID</b></span></div><div><span class="Apple-style-span" style="font-size:small;"><b>Go to Layout[History]</b></span></div><div><span class="Apple-style-span" style="font-size:small;"><b>Import Records[No dialog;"$path";Add;Mac Roman]</b></span></div><div><span class="Apple-style-span" style="font-size:small;"><b>Go to Layout[Original Layout]</b></span></div><div><br /></div><div>And that's all.</div><div>So first we set the global field, then generate a path using Get(TemporaryPath) and save it to the $path variable.</div><div>Then we export the fields, go to the History layout and import it into the history fields.</div><div><br /></div><div>Note: You need to be sure to set up both the export and import orders correctly!</div><div>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!</div><div><br /></div><div><br /></div></div><div><div><span class="Apple-style-span" style="font-family:Helvetica, serif;"><div><b><span class="Apple-style-span" style="font-size:large;">Please visit our site, </span></b><a href="http://crm.fm/"><b><span class="Apple-style-span" style="font-size:large;">http://crm.fm</span></b></a><b><span class="Apple-style-span" style="font-size:large;"> which has our main FileMaker product, and support us by buying it. Thanks!</span></b></div><div><span class="Apple-style-span" style="font-size:small;"><div><br /></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); line-height: 18px; "><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:small;"><b>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.</b></span></span></span></div></span></div></span></div></div>Adam Vargahttp://www.blogger.com/profile/12064907555672929238noreply@blogger.com0tag:blogger.com,1999:blog-322614545360974250.post-91015505860971008812009-11-30T02:10:00.000-08:002009-11-30T02:22:42.574-08:00FileMaker Flot Chart (offline charts without plugins)<div style="text-align: center;"><br /></div><div>When it comes to FileMaker charting, developers usually start thinking about plugins, or online web viewer (for example: Google Chart API) solutions.</div><div style="text-align: center;"><br /></div><div>In the following example I show you how you can create an offline chart in FileMaker which looks great.</div><div><br /></div><div><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 329px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_U4u-uq6D09Qij3MsN12Mnz3n0SxSfDnFOCS3LarjCnUYMS1hM5cKTrkIh8g9L_9UWn024GOjKFFczfqDxPxM1QGiY7gEiPCdfRmmbKV_8veiAFRLNN9u1tLsPvmeO8PUrMJQvaokH-4/s400/chartsample.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5409839881007142002" /></div><div><br /></div><div>I came across <a href="http://code.google.com/p/flot/">Flot</a> when I was looking for javascript graph solutions, and I really liked it.</div><div>Though I will use this. You can download the source of it, which has great example files as well.</div><div><br /></div><div>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.</div><div><br /></div><div>Then using this, and the field data, I created a web viewer which will display those fields to me.</div><div><br /></div><div>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.</div><div><br /></div><div>The demo file can be downloaded from <a href="http://crm.fm/downloads/FMFlotChart.zip">here</a> .</div><div><br /></div><div><span class="Apple-style-span" style=" ;font-family:Helvetica, serif;"><div><b><span class="Apple-style-span" style="font-size:large;">Please also visit our site, </span></b><a href="http://crm.fm/"><b><span class="Apple-style-span" style="font-size:large;">http://crm.fm</span></b></a><b><span class="Apple-style-span" style="font-size:large;"> which has our main FileMaker product, and support us by buying it. Thanks!</span></b></div><div><span class="Apple-style-span" style="font-size:small;"><div><br /></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); line-height: 18px; "><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:small;"><b>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.</b></span></span></span></div></span></div></span></div>Adam Vargahttp://www.blogger.com/profile/12064907555672929238noreply@blogger.com0tag:blogger.com,1999:blog-322614545360974250.post-25000978377437131372009-11-26T09:56:00.001-08:002009-11-27T01:44:03.304-08:00FileMaker Multiple word(part) portal filter<div style="text-align: center;"><br /></div><div style="text-align: left;"><span class="Apple-style-span" style=" ;font-size:small;">This technique might be known by some, but I'm pretty sure that it isn't know by many.</span></div><div><span class="Apple-style-span" style="font-size:small;">What we want to create is a multiple word (or wordpart) portal filter.</span></div><div><br /></div><div><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 345px; height: 400px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaRZGfZL5BlVHZ2Z468zStPRFQCcP970Wr84XcMsytx1Wm2S_Kp2M65OEWp51kJEdKSLESj-cEnCY5MYpUmM8bho5vTyOrYcjwZcjcsiJsqGn_W4SHf2QANgy39O_IsCtHZxEK6E9zRCQ/s400/portalfilter.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5408716780241794034" /></div><div style="text-align: center;"><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div><span class="Apple-style-span" style="font-size:small;">Many single word FileMaker portal filter demonstrations can be found on the net, but currently I needed one that can filter by multiple words.</span></div><div><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div><span class="Apple-style-span" style="font-size:small;">Here's how I did it.</span></div><div style="text-align: center;"><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div><span class="Apple-style-span" style="font-size:small;">First we need a searchfield on the layout. I called this SearchField_Display.</span></div><div><span class="Apple-style-span" style="font-size:small;">Then we need a custom function that can create the variations of our fields.</span></div><div style="text-align: center;"><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div><span class="Apple-style-span" style="font-size:small;">I chose AllTextCombination by Peter Gort (it can be seen </span><a href="http://www.briandunning.com/cf/25"><span class="Apple-style-span" style="font-size:small;">here</span></a><span class="Apple-style-span" style="font-size:small;">, at Brian Dunning's custom function library).</span></div><div><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div><span class="Apple-style-span" style="font-size:small;">With this function we create an AllVariation field based on our fields:</span></div><div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><b>AllTextCombinations ( FirstName ) &"¶" & AllTextCombinations ( LastName ) & "¶" & AllTextC</b></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><b>ombinations ( City ) & "¶_ALL_"</b></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><span class="Apple-style-span" style="font-size:small;">The "¶_ALL_" at the end will be important later. That's used to show all the records is the searchfield is empty.</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><span class="Apple-style-span" style="font-size:small;"><br /></span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><span class="Apple-style-span" style="font-size:small;">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).</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><span class="Apple-style-span" style="font-size:small;"><br /></span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><span class="Apple-style-span" style="font-size:small;">I call them SearchField1, SearchField2 and SearchField3, and they are unstored text calculations:</span></p><p style="text-align: center;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; "><span class="Apple-style-span" style="font-size:small;"><br /></span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><span class="Apple-style-span" style="font-size:small;">SearchField1:</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><b>Let ( s = Substitute ( SearchField_Display ; "-" ; " " ) ;If ( IsEmpty(s) or IsEmpty(MiddleWords(s;1;1)) ;"_ALL_";MiddleWords(s;1;1)</b> ))</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><span class="Apple-style-span" style=" ;font-family:Georgia, serif;font-size:16px;"></span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; "><span class="Apple-style-span" style=" ;font-size:small;">SearchField2:</span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; "><span class="Apple-style-span" style=" ;font-size:small;"></span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; "><b>Let ( s = Substitute ( SearchField_Display ; "-" ; " " ) ;If ( IsEmpty(s) or IsEmpty(MiddleWords(s;2;1)) ;"_ALL_";MiddleWords(s;2;1)</b> ))</p><p style="text-align: center;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; "><br /></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; "><span class="Apple-style-span" style=" ;font-family:Georgia, serif;font-size:16px;"></span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; "><span class="Apple-style-span" style=" ;font-size:small;">SearchField3:</span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; "><span class="Apple-style-span" style=" ;font-size:small;"></span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; "><b>Let ( s = Substitute ( SearchField_Display ; "-" ; " " ) ;If ( IsEmpty(s) or IsEmpty(MiddleWords(s;3;1)) ;"_ALL_";MiddleWords(s;3;1)</b> ))</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; "><br /></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; ">As you may notice the only difference is the word which we get from them.</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; ">I also used a Substitute ("-" to a Space char) as my data contained many "-" chars, and I wanted them as different words).</p><p style="text-align: center;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; "><br /></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; ">By these we can create a relation to AllVariation:</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; "><br /></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; "><br /></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; "><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 374px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXWCHDlNH3878t-l-ZrY5vu9LePuUMml3d5kyYK1QmbZMI_kFTA9ghXn4EtAKRkaOuoGZpQQS3qDyj_cKINWnhcCm-cryhYrYfo4OfiXFrO9I13HR95YqlEYhVEyxEThUyksBZMcJxaI0/s400/relation.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5408476153668977666" /></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; ">As you can see we'll have 3 criterias. (If you want 4 word you'll need 4).</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; "><br /></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; "><span class="Apple-style-span" style="font-size:small;">After this, if we use the portal filter we'll be able to search for things like: "</span><span class="Apple-style-span" style="font-family:Helvetica, serif;"><span class="Apple-style-span" style="font-size:small;">we la c", or "an li v" or "Bil bar abi" so basically any part of our fields.</span></span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; "><span class="Apple-style-span" style="font-family:Helvetica, serif;"><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style=" ;font-family:Georgia, serif;font-size:16px;">I attached a demo file which you can download from <a href="http://crm.fm/downloads/MultipleWordPortalFilter.fp7">here</a> . (right click- save as).</span></span></span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; "><span class="Apple-style-span" style="font-family:Helvetica, serif;"><span class="Apple-style-span" style="font-size:-webkit-xxx-large;"><span class="Apple-style-span" style=" ;font-family:Georgia, serif;font-size:16px;"></span></span></span></p><span class="Apple-style-span" style="font-family:Helvetica, serif;"><div><br /></div><div><span class="Apple-style-span" style="font-size:small;">Note1:The demo uses Brian Dunning's sample data database which I downloaded from </span><a href="http://www.briandunning.com/sample-data/"><span class="Apple-style-span" style="font-size:small;">here</span></a><span class="Apple-style-span" style="font-size:small;">.</span></div><div><span class="Apple-style-span" style="font-size:small;">Note2: I used many fields in the AllVariation field which makes the index huge. You shouldn't need to do that!</span></div><div><br /></div><div><span class="Apple-style-span" style="font-size:large;"> </span><b><span class="Apple-style-span" style="font-size:large;">Please also visit our site, </span></b><a href="http://crm.fm/"><b><span class="Apple-style-span" style="font-size:large;">http://crm.fm</span></b></a><b><span class="Apple-style-span" style="font-size:large;"> which has our main FileMaker product, and support us by buying it. Thanks!</span></b></div><div><span class="Apple-style-span" style="font-size:small;"><div><br /></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); line-height: 18px; "><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:small;"><b>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.</b></span></span></span></div></span></div></span><p></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; "><span class="Apple-style-span" style="font-family:Helvetica, serif;font-size:100%;"><span class="Apple-style-span" style="font-size:12px;"><br /></span></span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; "><span class="Apple-style-span" style="font-family:Helvetica, serif;font-size:100%;"><span class="Apple-style-span" style="font-size:12px;"><br /></span></span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; "><br /></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; "><br /></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; "><br /></p><p></p><p></p><p></p><p></p><p></p></div>Adam Vargahttp://www.blogger.com/profile/12064907555672929238noreply@blogger.com0tag:blogger.com,1999:blog-322614545360974250.post-16846777025032189632009-11-26T02:10:00.000-08:002009-11-26T02:31:44.716-08:00FileMaker Snake game - a FM 10 Demonstration<div style="text-align: center;"><br /></div><div style="text-align: center;"><br /></div><div><div><span class="Apple-style-span" style="font-size:small;">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.</span></div><div style="text-align: center;"><br /></div><div><span class="Apple-style-span" style="font-size:small;">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?</span></div><div><br /></div><div><span class="Apple-style-span" style="font-size:small;">It could demonstrate layout triggers (OnLayoutKeyStroke), Timers (speed of the game)</span></div><div><span class="Apple-style-span" style="font-size:small;">.</span></div><div><br /></div><div><span class="Apple-style-span" style="font-size:small;">Heres is what I came up with:</span></div><div><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 280px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqMfPq4zSjUNARwY4gcpHiwkrJ2-2JTF7nL87zlqcKR-NWTUCxngYlP7qjHQbhlio0V3gKvzmmqYiY3eYgDt0-R7YgyYncTV57NHcX5GtVPBr6IgD3cKI3Zq95wN2a5A6XGCMYNCD85Gs/s400/fmsnake.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5408354114091642530" /></div><div><div style="text-align: center;"><br /></div><span class="Apple-style-span" style="font-size:small;"> <div style="text-align: center;"><br /></div><div style="text-align: center;"><br /></div>The main layout is a repeating field container (300 repetitions actually), arranged.</span></div><div><span class="Apple-style-span" style="font-size:small;">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).</span></div><div><span class="Apple-style-span" style="font-size:small;">Two colors are used, Green and White:</span></div><div><br /></div><div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjg19fWpneGniK8mgnnZbz_CW_bevFVuoENfvuyDdDRcueJ9d5ATLLSrE8QFDYubHYX1oVK3fttNMSRla3OzfNsyQ0Yl6lvTKhU4GspGKLEgMQqZBIVwBr0KW1rie4P8rKMPINUuUibYQw/s1600/condformat.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 299px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjg19fWpneGniK8mgnnZbz_CW_bevFVuoENfvuyDdDRcueJ9d5ATLLSrE8QFDYubHYX1oVK3fttNMSRla3OzfNsyQ0Yl6lvTKhU4GspGKLEgMQqZBIVwBr0KW1rie4P8rKMPINUuUibYQw/s400/condformat.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5408356312977191474" /></a><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div><span class="Apple-style-span" style="font-size:small;">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.</span></div><div><br /></div><div><span class="Apple-style-span" style="font-size:small;">The script names of the demo file shows what they do exactly, you could easily figure them out.</span></div><div><br /></div><div><span class="Apple-style-span" style="font-size:small;">The layout has a script trigger, which is to check for keyboard input, so we can move the snake.<br /></span><div><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div><span class="Apple-style-span" style="font-size:small;">This is a FM10 demo, which you can download from <a href="http://crm.fm/downloads/FMSnake.fp7">here</a> . (right click- save as)</span></div><div><br /></div><div><span class="Apple-style-span" style="font-size:small;">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.</span></div><div><br /></div><div><span class="Apple-style-span" style="font-size:small;"><div><span class="Apple-style-span" style="font-size:large;">Note2: </span><b><span class="Apple-style-span" style="font-size:large;">Please also visit our site, </span></b><a href="http://crm.fm/"><b><span class="Apple-style-span" style="font-size:large;">http://crm.fm</span></b></a><b><span class="Apple-style-span" style="font-size:large;"> which has our main FileMaker product, and support us by buying it. Thanks!</span></b></div><div><br /></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); line-height: 18px; "><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:small;"><b>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.</b></span></span></span></div><br /></span></div></div></div>Adam Vargahttp://www.blogger.com/profile/12064907555672929238noreply@blogger.com1tag:blogger.com,1999:blog-322614545360974250.post-6321849225453859312009-11-24T05:25:00.000-08:002009-11-25T02:31:51.681-08:00Filemaker MineSweeper clone<div style="text-align: center;"><br /></div><span class="Apple-style-span" style="font-size:small;">Though about creating a board game in FileMaker to demonstrate the capabilities of FileMaker Pro.<br />Started it, finished in about 2 hours.</span><div><br /></div><div><span class="Apple-style-span" style="font-size:small;"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 333px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCfJsY5V1gmrLc0vXsWc1_DuhrNPKQVtqIIqxiup6FaSBBdyYRmVYKi4njv6l6G7gPiCkBcT6vr_VzKTUmZcf6rRZUq2mlXZsUutl1So9IsT-COE_KquyxHieTqBQ-vlZUdz-tnf4Ycw8/s400/FmMineSweeper.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5407669260827544946" /><br />So here it is, actually it's pretty straight forward and fully unlocked so you can check it.<br /><br />The main fields of the database are the Display, and the Game Repeating field.<br />The Display shows the board, while the Game contains the yet unrevealed fields, mines.<br /><br />The Init method initializes the board, sets the random mines, counts the neighbor cells (how many one mine has), etc.<br />The ClickHandler method takes care of the clicks, by using hidden clickable layout elements behind the repeating fields.<br />(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 </span><a href="http://www.myfmbutler.com/index.lasso?p=422"><span class="Apple-style-span" style="font-size:small;">Clip Manager 3</span></a><span class="Apple-style-span" style="font-size:small;"> by MyFmButler. (Maybe I will show this technique in a separate article later if you're interested).</span><div><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div><span class="Apple-style-span" style="font-size:small;">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.</span></div><div><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div><span class="Apple-style-span" style="font-size:small;">This is a FM8+ demo, which you can download from <a href="http://crm.fm/downloads/FmMinesweeper.fp7">here</a> . (right click- save as)</span></div><div><br /></div><div><span class="Apple-style-span" style="font-size:small;">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</span></div><div><br /></div><div><span class="Apple-style-span" style="font-size:small;"><div><span class="Apple-style-span" style="font-size:large;">Note2: </span><b><span class="Apple-style-span" style="font-size:large;">Please also visit our site, </span></b><a href="http://crm.fm/"><b><span class="Apple-style-span" style="font-size:large;">http://crm.fm</span></b></a><b><span class="Apple-style-span" style="font-size:large;"> which has our main FileMaker product, and support us by buying it. Thanks!</span></b></div><div><br /></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); line-height: 18px; "><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:small;"><b>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.</b></span></span></span></div><br /></span><br /></div></div>Adam Vargahttp://www.blogger.com/profile/12064907555672929238noreply@blogger.com2tag:blogger.com,1999:blog-322614545360974250.post-84209035360201237052009-11-24T03:41:00.000-08:002009-11-25T02:25:15.665-08:00Filemaker - Using Growl without plugins<span class="Apple-style-span" style="font-size:small;">In this article I will show you how to create a simple <a href="http://growl.info/">Growl</a> notification in FileMaker without additional plugins.</span><div><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div><span class="Apple-style-span" style="font-size:small;">I have a FileMaker ToDo list, which can be filled by some people. </span></div><div><span class="Apple-style-span" style="font-size:small;">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.</span></div><div><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div><span class="Apple-style-span" style="font-size:small;">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.</span></div><div><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div><span class="Apple-style-span" style="font-size:small;">That is where the following sample came from. </span></div><div><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div><span class="Apple-style-span" style="font-size:small;">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.</span></div><div><span class="Apple-style-span" style="font-size:small;">I started looking around for AppleScript samples how to use Growl, and found some on the <a href="http://growl.info/">Growl website</a>. I modified those to run from FileMaker.</span></div><div><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div><span class="Apple-style-span" style="font-size:small;">The Growl notification is a simple calculated Perform AppleScript command:</span></div><div><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div><span class="Apple-style-span" style="font-size:small;">----</span></div><div><span class="Apple-style-span" style="font-size:small;"><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'">"tell application \"System Events\"¶</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><span class="Apple-tab-span" style="white-space:pre"> </span>set isRunning to count of (every process whose name is \"GrowlHelperApp\") > 0¶</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'">end tell¶</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'">¶</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'">if isRunning then¶</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'">tell application \"GrowlHelperApp\"¶</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'; min-height: 13.0px"><br /></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><span class="Apple-tab-span" style="white-space:pre"> </span>register as application \"GrowlSampleApp\" all notifications {"& Quote ("TestNotify") & "} default notifications {"& Quote ("TestNotify") & "} icon of application \"FileMaker Pro" & Case ( PatternCount ( Get ( ApplicationVersion ) ; "Advanced" ) ; " Advanced\"" ; "\"" ) & "¶</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'; min-height: 13.0px"><br /></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><span class="Apple-tab-span" style="white-space:pre"> </span>notify with name "& Quote ("TestNotify") & " title " & Quote (GrowlSample::Title) & " description " & Quote(GrowlSample::GrowlText) & " application name \"GrowlSampleApp\""& " sticky "& Quote (GrowlSample::Sticky) &"¶</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'; min-height: 13.0px"><br /></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'">end tell¶</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'">end if¶"</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'">----</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'">The first part checks if Growl is up and running. The second part registers the application, and notifies with the set parameters.</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'">The icon it shows is the Icon of FileMaker, but it can be changed to anything you wish.</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'">We also have to check for Get(LastError) -609 to be sure.</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'">I attached the sample file which you can download from <a href="http://crm.fm/downloads/GrowlSample.fp7">here</a>. (right click- save as!)</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><b>UPDATE:</b> A commenter (doug says:) <span class="Apple-style-span" style=" color: rgb(51, 51, 51); line-height: 20px; font-family:Georgia, serif;font-size:13px;">Here is a custom function that does a similar thing:http://www.briandunning.com/cf/1064</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><span class="Apple-style-span" style="font-family:Georgia, serif;font-size:100%;color:#333333;"><span class="Apple-style-span" style=" line-height: 20px;font-size:13px;"><br /></span></span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><span class="Apple-style-span" style=" color: rgb(51, 51, 51); line-height: 20px; font-family:Georgia, serif;font-size:13px;">Based on ideas and code from Michael Gaslowitz http://www.gaslowitz.net/filemaker/blog/2008/07/video-growl-integration/</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'">Thanks for that!</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'">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!</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><span class="Apple-style-span" style="font-family:Georgia, serif;font-size:100%;color:#333333;"><span class="Apple-style-span" style=" line-height: 20px;font-size:13px;"><span class="Apple-style-span" style="font-family:'Lucida Grande', serif;font-size:100%;color:#000000;"><span class="Apple-style-span" style=" line-height: normal;font-size:11px;"><br /></span></span></span></span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><span class="Apple-style-span" style=" ;font-family:Georgia, serif;font-size:16px;"></span></p><div>Please also visit our site, <a href="http://crm.fm/">http://crm.fm</a> which has our main FileMaker product. Thanks!</div><div><br /></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); line-height: 18px; "><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:small;"><b>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.</b></span></span></span></div><p></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'"><br /></p></span></div>Adam Vargahttp://www.blogger.com/profile/12064907555672929238noreply@blogger.com2tag:blogger.com,1999:blog-322614545360974250.post-14725108472652421522009-11-22T09:32:00.000-08:002009-11-22T09:58:42.347-08:00Filemaker - Applescript Printer list / faxing a file<blockquote></blockquote><div>In the following artice I will show you two methods that I have created in my solutions.</div><div><br /></div>If you want a list of your installed printers in FileMaker you can use a simple applescript.<div><br /></div><div>I show you two methods. Each of them requires a <span class="Apple-style-span" style=" ;font-family:'Lucida Grande', serif;font-size:13px;">PrinterList_Global field in your database and on the layout where you execute the script</span>. The script is a simple Perform Applescript command.</div><div><br /></div><div>The first method uses the print setup utility to get the printer list. You need to have a <span class="Apple-style-span" style=" ;font-family:'Lucida Grande', serif;font-size:13px;">PrinterList_Global field in your database and on the layout where you execute the script<span class="Apple-style-span" style=" ;font-family:Georgia, serif;font-size:16px;">:</span></span></div><div>----</div><div><span class="Apple-style-span" style=" ;font-family:'Lucida Grande', serif;font-size:13px;">tell application "Printer Setup Utility"</span></div><div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><span class="Apple-tab-span" style="white-space:pre"> </span>set allprinters to every printer</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><span class="Apple-tab-span" style="white-space:pre"> </span>set printernames to name of every printer</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'">end tell</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'">set backvalue to ""</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'">repeat with printername in printernames</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"> set backvalue to backvalue & printername & (ASCII Character(13))</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'">end repeat</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'">set cell "PrinterList_Global" of current record to backvalue</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'">---</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'">This can be used to set the default printer on OSX.</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'">2)</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'">The second option uses the lpstat OSX command to get the printer names. This will give you a different list. But the printer names this one gives can be used for the "lp"<span class="Apple-style-span" style="font-size:-webkit-xxx-large;"> </span>OSX command. This will be important later when we get to fax sending.</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'">---</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"> set oldDelims to AppleScript's text item delimiters</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"> set PrinterStatusList to {}</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"> try</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"> set cmd to "lpstat -p | grep ^printer"</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"> set PrinterStatus to do shell script cmd as text</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"> set AppleScript's text item delimiters to {" "}</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"> repeat with i from 1 to count of paragraphs of PrinterStatus</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"> set s to paragraph i of PrinterStatus</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"> set p to text item 2 of s as list</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"> copy p to end of PrinterStatusList</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"> end repeat</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"> on error</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"> set PrinterStatus to ""</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"> end try</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"> set AppleScript's text item delimiters to oldDelims</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'; min-height: 16.0px"><br /></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'">set backvalue to ""</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'; min-height: 16.0px"><br /></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'">repeat with printername in PrinterStatusList</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><span class="Apple-tab-span" style="white-space:pre"> </span>set backvalue to backvalue & printername & (ASCII Character(13))</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'">end repeat</p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'; min-height: 16.0px"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'; min-height: 16.0px">set cell "PrinterList_Global" of current record to backvalue</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'">--</p><p></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'">Okay, now you have the printer list. You can easily create a value list based on this, and let the user choose from it.</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'">What about faxing??</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'">This is where the lp command comes in.</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'">With lp you can send a file (pdf), to a number. </p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'">The syntax is the following:</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'">lp -d PrinterNameHere -o phone=PhoneNumberHere filepathandnameHere</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'">You can call this from FileMaker using a do shell script AppleScript Command.</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'">I attached a sample file for printer listing, the faxing is up to you, but based on this, you can easily create it.</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'">You can download the demo file <a href="http://crm.fm/downloads/PrinterListOSX.fp7">here</a>. (right click - save as).</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><span class="Apple-style-span" style="font-family: Georgia, serif; color: rgb(51, 51, 51); line-height: 20px; "></span></p><div>Be sure to check out: http://crm.fm as well :) Thanx!</div><div><br /></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); line-height: 18px; "><span class="Apple-style-span" style="font-family: arial; "><span class="Apple-style-span" style="font-size: small; "><b>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.</b></span></span></span></div><p></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'"></p></div>Adam Vargahttp://www.blogger.com/profile/12064907555672929238noreply@blogger.com5tag:blogger.com,1999:blog-322614545360974250.post-78143005878646304002009-11-21T14:25:00.000-08:002009-11-21T15:04:59.445-08:00Highlight Active Portal record with Conditional FormattingHere's a demonstration file I created for highlighting active portal record using conditional formatting.<div><br /></div><div><br /></div><div><img style="cursor:pointer; cursor:hand;width: 397px; height: 400px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2EDlhsfximIwO_4oB-mEqQgzrlSzWqWd6ZeORTWBwLakctYt334MnnuGQJ9-TryDqGkRz9hR13npCi6cO93Fs-oFT1B_zq4WI8fEhs2dwYmfkhQJ-qia9v8Om-CG6hQLx4CuKX6m8LAU/s400/activehighlighttech.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5406696545465795218" /></div><div>The attached example is a picture browser with a simple navigation system, and a preview portal. (I know it's ugly but it's just a technique demonstration ;) </div><div><br /></div><div>I could have used a container field to highlight the active portal element, but conditional formatting makes our life simpler :)</div><div><br /></div><div>I created a an empty (well, actually it has a space char in it) text element, resized it to th</div><div>e portal element size, then applied the following conditional formatting to it:</div><div><br /></div><div><br /></div><div><img style="cursor:pointer; cursor:hand;width: 400px; height: 352px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhn9fSsKxXTZ-DM3O2sh06L0J5fb6itNaAllkGDHnBnGT_O5vaxkS20Z5u2NMa9zRbjBH1F3vrWvcMY_YziyxHr6ZWUOztKmAycaznTWXPiUGGC4werY0xSEaEIS-EGukucBKYigDAHi0E/s400/condformat.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5406694558159654178" /></div><div>(Set Formulat to: If the related ID equals to the Current id, then apply a Fill color)</div><div><br /></div><div><br /></div><div>After this I put this text under the portal picture field, and send it backward.</div><div><br /></div><div>I attached the demo file which you can download to analyze the technique.</div><div><br /></div><div>You can download it <a href="http://crm.fm/downloads/ActiveRecordPortal.fp7">here</a>. (right click, save as)</div><div><br /></div><div>Be sure to check out: http://crm.fm as well :)</div><div><br /></div><div><span class="Apple-style-span" style=" color: rgb(51, 51, 51); line-height: 18px; "><span class="Apple-style-span" style="font-family:arial;"><span class="Apple-style-span" style="font-size:small;"><b>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.</b></span></span></span></div><div><br /></div>Adam Vargahttp://www.blogger.com/profile/12064907555672929238noreply@blogger.com0