Alpha-Snail Posted September 26, 2005 Posted September 26, 2005 (edited) Like many others out there, I've spent many hours trying to decipher Gaston Forgues' examples. He's a great great asset to the FM community, but what he's given us all is a bit difficult to understand. To be honest, I still don't fully understand it all myself, and I'm no novice. After spending the day trying to figure out the thing, the script that I was working on in FM 8 Adv. & Eventscript 1.1 wasn't working, so I contacted Gaston directly. (I did so because I was concerned about a possible bug with Eventscript. I don't recommend everyone do that, since this is freeware and we should all respect his time.) (By the way, there are no bugs.) In a nutshell, this is what he indicated the script structure should be: (If (Get(PrivledgeSetName) = A and Get (ActiveFieldName) = "B"; B & S4HU_EventScript (C; D; ""); B Now go back and substitute the following: A = Your privledge set name. (To find that, click through: "File/Define/Accounts & Privledges". Now don't make one of my mistakes and enter the file name in your fomula. Enter instead the name of the privledge set itself. B = The name of the field you are trying to make Eventscript do something to. Pay attention to the quotation marks in the formula above. C = The file name that you are writing this script for(and, presumably, in). D = The name of the script you want to execute. Note that all of this goes in Field B as a calculation of a text, number, date or container field. (It should never be a calculation field, since you are typing something in it, and calculation fields don't allow for that). Personally, what I did for A, B, C and D was to define separate global variables for each. So if you follow my example you might make A= gEvenscript_PrivledgeSet; C = gEventscript_Filename; and D = gEventscript_ScriptName. Then go into those fields and put in each one the value that you want. If you do it this way, none of the values in those fields should be in quotes (again, another one of my mistakes). (I understand that release 1.1 allows for the elimination of this process. Instead, you would enter the values themselves directly into the formula. This does, however, change when and when not to use quotation marks.) Finally, where the quotes appear in the formula is where your parameters go. You can leave that blank, in which case you would have to enter double quotes (""). Otherwise you place your parameters there. I noticed in Gaston's examples that he used "AU Param1" and "AU Param2". Now, here's where I get confused. I'm not sure what those or other parameters do since I couldn't find a definition of them anywhere. If anyone knows what those are, this would be a great post to share them with us all. The formula listed above works for me as an After Events command, which is also a bit confusing since Gaston's own After Event example uses AU Param1 and AU Param2 as parameters. So though I may not have the perfect explanation of everything about Eventscript, hopefully this will get many of you on the right track. Good luck and Godspeed! : Edited September 26, 2005 by Guest
Inky Phil Posted September 26, 2005 Posted September 26, 2005 Thanks for the explanation. It has come as somewhat of a relief that it is not only me that struggled. All last week I tried to untangle the built in explanations and it was with the help of vodkaman and slimjim that I finally got Eventscript working - although not really understanding it. Your input will help, Thanks again Phil. ps when I did get it working it was a WOW moment! What a piece of Freeware !!!
Homer Posted September 26, 2005 Posted September 26, 2005 I noticed in Gaston's examples that he used "AU Param1" and "AU Param2". Now, here's where I get confused. I'm not sure what those or other parameters do since I couldn't find a definition of them anywhere. Hi guys! I'm the Gaston you are talking about and what I meant by "AU Param1" and "AU Param2" is that you can send 1 or many script parameters when triggering the script. AU simply stands for "After Update" and these parameters are not really used in my example. This is just to show you the optional usage of the third parameter for EventScript. For the profit of everyone, I created a small FAQ webpage available at : http://softs4humans.com/support/eventscript_faq.htm Because, I agree with you that my example file is too complex.
Inky Phil Posted September 27, 2005 Posted September 27, 2005 Hey Homer / Gaston, Just wanted to jump back in and thank you for distributing Eventscript - Excellent work Many Thanks Phil
Alpha-Snail Posted September 28, 2005 Author Posted September 28, 2005 Gaston, Let me again thank you for both creating this great plugin and for your help in understanding it last weekend. I have found what appears to be one small caveot (I don't consider it a bug), however. I discovered it when renaming a file that uses the plugin. I changed the name from "FileName 1" to "Filename 1.1". The result was that the script that worked before stopped working completely. There are, of course, 3 ways to tell EvenScript the file name: "Get(Filename)"; the name of the actual filename (in quotes); or the name of the filename in a field (and not in quotes). I tried method one and three. Don't know about the second one. Anyway, it's not a big deal. Just don't enter that second dot in the filename.
Homer Posted September 28, 2005 Posted September 28, 2005 Most of the time, I think placing two dots in a filename is not a good idea. Especially under MsWindows. : But thanks for pointing this to me. - - By the way guys, I've just discover an incredible thing. Under FileMaker 8, using the new "Set tooltips" features, we can easily reproduces the popular "On MouseOver" event. Simply place a calculation like this : S4HU_EventScript( Get(FileName) ; "ToolTipScript" ; "" ) under the tooltip for an object on your layout and when a user is placing his mouse pointer over this object, Wow you can have a script be triggered without any mouse-click. I'm really excited and I guess this trick can be useful somewhere !?
Alpha-Snail Posted September 30, 2005 Author Posted September 30, 2005 What a great use for the "On MouseOver" events! Here's two ideas that could perhaps be useful to many: 1.)To provide additional information in a portal. The developer could create a script that would pop up a tool-tip with additional information, unique to each record that appears in the portal. Could look pretty impressive. 2.) Here's an even better idea! There's a fantastic website for creating free and easy to use Glassy Buttons. Works even for Windows based FM aps. It's http://www.netdenizen.com/buttonmill/glassy.php. I use it on one of my Windows based FM applications and they looks great! The only problem is that you can't "roll-over" the graphic image in the Windows version of Filemaker. Maybe with your idea you can. (I'm not sure how you would script it though.) ;)
HALBURN Posted June 17, 2006 Posted June 17, 2006 I have been looking over the EventScript demo file for over an hour and I am really having trouble grasping the basic concept of where and how the scripts are actually being triggered. The demo is too complex and has too many features and examples all wrapped into one database for a newbie like me to make sense of it. Let's assume for a minute that I have the following very simple database structure: 1 File: "Diary" 1 Table: "MyDiary" 1 Field: "Notes" 1 Script: "ShowDialog_EventScript_is_Awesome!" The desired result is that I want to trigger the script whenever the user enters anything into the "notes" and then exits the field. Can someone please explain where and how the trigger that runs the script is activated in the most basic of basics example?
HALBURN Posted June 17, 2006 Posted June 17, 2006 As a temporary solution I achieved the desired result with a sample plug-in function that came with FM8A called "XMpl_StartScript". I created a new field called "Trigger" and I entered the following as lookup calculation: If (Notes = "" ; "" ; XMpl_StartScript ( "MyDiary" ; "TestScript" ) ) I assume that triggering EventScript works off of the same principle but I still can't seem to get it to work. Any pointers would be greatly appreciated.
Genx Posted June 18, 2006 Posted June 18, 2006 Just regarding the period in the filename, it's got nothing to do with gaston's plug-in - i don't think. The get(filename) function used by filemaker stops looking after the first period because it assumes that everything after the first period is an extension. Basically Filename_1.0.fp7 would be read as Filename1.0 instead of Filename_1.0.fp7 if your really in to deep to be able to change your filename use Get(filename) & ".fp7" or make yourself a custom function for the sake of it. ~Genx
Genx Posted June 18, 2006 Posted June 18, 2006 Btw Gaston, thank's for the faq, it really really helps. :)
Homer Posted June 19, 2006 Posted June 19, 2006 Hello guys. Thanks for your kind words and here's some quick comments First, for those who may be interested, the FAQ page refered by Genx is available here: http://softs4humans.com/support/eventscript_faq.htm In fact, the first demo file named "EventScript Samples.fp7" is absolutely too complex. While the FAQ is offering a simpler approach. Secondly, Genx is right about the problem with multiple periods into filenames. A correct filename should include no more than 1 period. This isssue is documented on this page http://softs4humans.com/support/eventscript_known_issues.htm But actually the file offered by Ohgo_Ohgo should works fine because this is a .zip file. Once uncompressed, the resulting FileMaker file should be Diary.fp7 (with only 1 period). Third and last thing, I saw an error inside the Ohgo_Ohgo's file and I took a moment to make the corrections. Please find the revised demo for Diary here : GF-Diary.zip
Ohgo_Ohgo Posted June 19, 2006 Posted June 19, 2006 I saw an error inside the Ohgo_Ohgo's file and I took a moment to make the corrections. Please find the revised demo for Diary here Thanks Homer ! I am an Idi.t ;-) I used the wrong plug-in zipptScript which is another Trigger script. I did not realise because both "free" plug-ins are installed in my FM. Thanks & sorry !
Genx Posted June 19, 2006 Posted June 19, 2006 Just to let everyone know, i really am to deep to try changing my filename and i was unfortunate enough to have put two periods in my filename at the begining. The point is, referencing it fully still works as long as you don't try using the native Get(Filename) function. (note that this is tested in seperation model with both files .. most importantly the file in which the script was being triggered .. having two periods in the filename.) And i think i have the hang of it now Gaston, thank you sooooo much. ~Genx
Genx Posted June 22, 2006 Posted June 22, 2006 Regarding this again - I'm trying to execute a script that allows for reversion or edit (where the field is blanked). I've tried both the Validation and auto enter method. The script calls fine, it's just that if the user clicks out of the record and commits it - while the script still executes, reversion does nothing and then an invalid value sits there. Any suggestions?
Genx Posted June 22, 2006 Posted June 22, 2006 On second thoughts, i might execute a value trap on entry to the field and then restore only that value if the user enters something incorrectly into a large text field - rather than reverting the whole record.
Recommended Posts
This topic is 6798 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now