Newbies Shane Karkey Posted April 13, 2002 Newbies Posted April 13, 2002 I'm creating a script to perform a find based on manipulation of some fields entered by the user. This script then calls PerformFind[]. The script is currently attached to a button and works correctly. However, many end-users of the data base are likely to type the 'ENTER' key to start the find going, instead of clicking the button. How can I "trap" the ENTER key in a field so that it also starts the script?
RussBaker Posted April 13, 2002 Posted April 13, 2002 You could just pause the script at the point where users enter the find criteria, then clicking ENTER will resume the script and execute the find. Russ
agraham999 Posted April 13, 2002 Posted April 13, 2002 I agree...I think that would work...based on what you mentioned.
Fitch Posted April 13, 2002 Posted April 13, 2002 IOW, you make a script that goes to the Find layout, then Pause. Now the user can enter criteria, and the Enter key will continue the script... which can simply be to call your PerformFind[]. script.
Newbies Shane Karkey Posted April 14, 2002 Author Newbies Posted April 14, 2002 Thanks for the tips! I've give the "paused script" method a try. On the face of it, it sounds like it will do what I want, although I'm just a little concerned at leaving a script "hanging around" in case another script is called (there are a few other buttons). But it should be okay. Expanding further on the first post, is trapping keystrokes the sort of thing that can be down with Plugins, or is it too low-level? Any Plugins on the market that offer such control?
RussBaker Posted April 14, 2002 Posted April 14, 2002 There are plugins which will allow you to trigger a script on exiting a field - I think its one of Troi's but don't know the name. Leaving a script "hanging around" is not normally a problem. If you are single user, then a scripted button to execute another script is OK, and if you are running a file hosted from either a server or peer-to-peer, then its OK to have your script paused while others work - you may need to investigate record locking. Russ
Gogargirl Posted April 14, 2002 Posted April 14, 2002 If you are concerned about leaving a script "hanging around" here's a suggestion: Create a duplicate layout where the script is performed. Either disable the buttons for the other scripts (which can be confusing in some circumstances) or create a sub-script that runs at the beginning of the other scripts to check the layout name e.g. If(StatusCurrentLayoutName) = "Script Layout" ShowMessage "You are in the middle of blah blah. Click Enter to continue." Exit Script End If You can achieve the same without a duplicate layout by setting a global field on your normal layout with "script running" (or whatever) as the script starts. Test for this value at the beginning of the other scripts. And remember to set the global field to clear when the script completes.
Keith M. Davie Posted April 14, 2002 Posted April 14, 2002 One of the problems with placing a script into pasue mode is that another script can be run by a second user and which could interfere with a "resume script" command submitted by the first user. ScriptMaker is single-threaded, and this cannot be emphasized enough. If you do not mind the pause (because of a lack of likelihood of conflict with others) you may find the topic "multiple fields required for search" (last entry march 20, 2002), in the forum "Finding & Searching") to be useful.
Recommended Posts
This topic is 8263 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