RickGrundy Posted November 20, 2003 Posted November 20, 2003 First, I apologize if this has been asked recently, I seached the forum to no avail... Is there a way to trigger a script to run when a field changes? I would like to be able to trigger a script to run immediately after a user makes a choice from a pop-up menu, without requiring them to click a button. Is this possible? Thanks.
Kundinger Posted November 20, 2003 Posted November 20, 2003 Hi Rick, Quick answer... NO! Can't be done! ...Ahhhhhh... but it can be done with a 'little' work! Think Outside the Box! My Two Cents worth... I sure wish FMI would add some 'technology' to their FMP applications... I would love to see a 'state' function similar to how HyperCard used to work... 'onMouseOver', 'onMouseUp', etc. HyperCard could track system changes to any object in the system, and then perform other tasks, based on the changes. Sorry for digressing... You can have a "field-triggered-script"! LOTS of WORK... AIN'T PRETTY... but it can be done! Simple explanation... use a value list displayed in a 'pop-up' list (text field), set the field to be a button that performs a script, the script: - exit record/request - goto field (your list) - pause 3 seconds - if... - then... - else... - endif This is a very simplistic explanation... I'm assuming you will get the gist of my idea. If you need further details, let me know. I could create a simple sample file for you to 'tear' apart and play with. Good Luck! Bob Kundinger [email protected]
Charles Delfs Posted November 21, 2003 Posted November 21, 2003 hmm, way to hard, just use the free RUNSCRIPT plugin in the validate by calculation area. The script will run when ever FM tries to validate the change. Charles
Lee Smith Posted November 21, 2003 Posted November 21, 2003 Hi Charles, I don't find any reference to a file named RUNSCRIPT, nor is there an area called validate by calculation. How about posting a link. Lee
RickGrundy Posted November 21, 2003 Author Posted November 21, 2003 Thanks for the suggestions so far! A link to the RUNSCRIPT method/plugin would be much appreciated. Thanks to Bob Kundinger for the first suggestion. Though it is a valid solution, I am concerned about having a maintenance nightmare on my hands if someone else ever needs to figure out what I was doing... Please let me know if it is really easier than it looks initially, Bob. I do agree with Bob that one of the best additions to the next version of FM would be methods such as onMouseOver() and onChange(), etc. This would add huge functionality and can't be too hard to implement.
Kundinger Posted November 21, 2003 Posted November 21, 2003 Hi Rick, I don't think that my solution is the best, but it works and doesn't require plug-ins. I don't think you or anyone else for that matter should have trouble understanding it. I will try to post a simple sample file for everyone to look at... hopefully within the next week. I did look at the web page with the RUNSCRIPT info... it looks good. Personally, I prefer to stay away from plug-ins in most of my solutions. I have found some very good ones and have used some. But when it comes to solutions that contain multiple plug-ins, there is can be nightmares with licensing, upgrades, etc. Yeah... we need a more robust FileMaker. Call it HyperFileMaker... HyperCard interface development with a FileMaker multi-user database... similar to other relational products with tables and interface components. Maybe someone out there knows of a HyperCard like product with a relational, multi-user database system. Nuf Said... Bob Kundinger [email protected]
RickGrundy Posted November 21, 2003 Author Posted November 21, 2003 Thanks Bob. I'll be interested to see your example. I looked at the RUNSCRIPT page as well and found I can't use it because it is Windows only. We have a mixed environment here so I can't have it work on one user's system but not the other. As far as maintaining the script, I am pretty anal about commenting in scripts so with a good example (thanks Bob), I can probably make it so it won't be the headache I thought. Thanks again.
Lee Smith Posted November 21, 2003 Posted November 21, 2003 Charles Delfs said: hmm, way to hard, just use the free RUNSCRIPT plugin in the validate by calculation area. The script will run when ever FM tries to validate the change. Charles I found this link: http://www.fmpro.org/news/136464328518/ But it isn't Free and it isn't Xplat (Windows Only). Lee
RickGrundy Posted November 21, 2003 Author Posted November 21, 2003 Lee, Thanks for posting the link. That is the same article I had found. The cost and the fact that it is Windows only make it unusable for my situation. The more I look into this issue, the more I am surprised that it is not already included in FileMaker...
Lee Smith Posted November 21, 2003 Posted November 21, 2003 [color:"blue"] > The more I look into this issue, the more I am surprised that it is not already included in FileMaker... Don't be to surprised, it is just one of many things that we developers have been hounding FileMaker to include in FM for many years now. Lee
Charles Delfs Posted November 25, 2003 Posted November 25, 2003 As I said earlier the plugin is called runscript, (not the function that you call) And it is free, here's the link http://costello_ryan.tripod.com/ Charles "So quick they are to pounce"
Lee Smith Posted November 25, 2003 Posted November 25, 2003 [color:"blue"] As I said earlier the plugin is called runscript, (not the function that you call) And it is free, here's the link http://costello_ryan.tripod.com/ Charles "So quick they are to pounce" I don't think we were too quick to pounce. I had asked you post a link, when you didn't respond, a search returned only the link I posted. BTW, the link you posted today gives a beach ball and then times out. I have tried it several times over the last half hour. Lee
jondolar Posted November 25, 2003 Posted November 25, 2003 Hi Charles Your link for runscript is dead Serge
dbruggmann Posted November 25, 2003 Posted November 25, 2003 I could successfully download the Plugins some hours ago
jondolar Posted November 25, 2003 Posted November 25, 2003 Hi You'r right The link works now and the plugin works beautifully. Thanks
mse Posted November 26, 2003 Posted November 26, 2003 RickGrundy said: I would like to be able to trigger a script to run immediately after a user makes a choice from a pop-up menu, without requiring them to click a button. Is this possible? Here you are... don't remember its original location (Databasepro ?). Oops... the attachment lost
cjaeger Posted November 28, 2003 Posted November 28, 2003 There is a similar plugin for MacOS X from abstract, which is free. It let's you run shell scripts. And AppleScripts, which in turn trigger a script in FileMaker. But you can do the same with a simple loop in a compiled AppleScript Applet.
bruceR Posted December 1, 2003 Posted December 1, 2003 cjaeger said: There is a similar plugin for MacOS X from abstract, which is free. It let's you run shell scripts. And AppleScripts, which in turn trigger a script in FileMaker. But you can do the same with a simple loop in a compiled AppleScript Applet. Wow, seems very powerful. But for triggering Filemaker scripts - the subjec of this thread - I still find the old problem must be worked around, if you attempt to cause it to run a FileMaker script, Filemaker locks up because the shell and FileMaker get in a loop waiting for each other. What method are you using to avoid this? I'm assuming you would pass an osascript statement to the shell script.
bruceR Posted December 1, 2003 Posted December 1, 2003 Well here's one solution. As noted here: http://developer.apple.com/technotes/tn2002/tn2065.html You can have the shell script return an immediate result, like this: do shell script "my_command > /dev/null 2>&1 & echo $!" So if FileMaker executes a shell script calling Filemaker this will work: do shell script "osascript -e 'tell application "FileMaker Developer"' -e 'activate' -e 'do script FileMaker Script "YourScript" ' -e 'end tell' > /dev/null 2>&1 & echo $!"
Recommended Posts
This topic is 7666 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