Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 8263 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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?

Posted

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
Posted

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?

Posted

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

Posted

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.

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.