Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Automate Return Key (on a Mac) to perform a script

Featured Replies

Hi!

Is it possible to have a script be activated by pressing the "return" key? I have a search page that I want my users to be able to just hit return after they have typed in their criteria which will then run a script that will take them to a list page.

Hi:

Well, when you are in Find Mode (as when you are doing a search) hitting enter will perform the find. You could have a script take the user to the search page, enter find mode [pause], have them enter search criteria, perform find [ ], and whatever else you want.

Other than that, there is a few plugins that can activate upon field activity. One is called Oazium Events.

Ken

Well,

It's kind of limited use, but I already used it, and the user liked it, so...

It works for one field only

You can only enter a value without carriage return in it

Add these fields to your file

g_countreturns (numeric)

c_countreturns = Patterncount(Field X, " par.gif")

Field X at left side is a global field involved in a relationship Global::Related File:FieldX(indexed)

Then the script will go :

Go to Layout (Search)

SetField(g_countreturns,0)

Loop

End Loop If (c_countreturns>g_countreturns)

Go to field X (select)

Pause/Resume (00:00:01)

End Loop

Insert Calculated result (Substitute(field X,Right(field X,1),"")

If(Is Valid(your relationship)

Go To Related Records

Perform External script (go to List Layout)

As you can see, the script is perform when a new carriage is introduced which limits the use of this script to single relationship match (not multikey)

Hi,

As I wasn't so sure of the script, I attached it to a demo file.

This demo contains other "find tips". Yours is attached in the small tabbed interface button labelled "Adv Search" or simply choose the last script attached to the file.

You'll have to go to the form mode to try it again.

Well, of course, you should turn the Allow user Abort and Error Capture in the definitive version. But it works fine.

Booksv2.fp5.zip

Other than methods pointed to you be Ugo and Ken you could try the following:

Define the "Find Script"

Allow user abort [off]

Set Error Capture [on]

Go To Layout ["find layout"]

Enter Find Mode[ ]

Freeze Window

Pause/Resume Script [ ]//for ever

Perform find [ ]

If [status(CurrentFoundCount)]

If [status(CurrentFoundCount)=1]

Go ToLayout [form]

else

Go ToLayout

end if

else

//Handle errors, show message etc

end if

Dj

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.