Jump 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.

Get Cursor Location to enter text at that point

Featured Replies

Filemaker Pro 11 Adv

Can't locate a (Get CursoPosition) function.

I'm looking to cut the text from a "INSERTNOW" field and place it in a "NOTES" field, at exactly the point where I have the cursor positioned. Cursor position will change from record to record, according to my needs. I would manually move the cursor to a different location in the field, for each record.

IE:

sample text in the "NOTES" field: What the world needs now is love.

Should I have the cursor at the end of the word What, I'd like to insert the text from "INSERTNOW", at that point.

OR

Should I have the cursor at the end of the word needs, I'd like to insert the text from "INSERTNOW", at that point.

Wherever the cursor is, is where I need the text to be inserted, simply by pressing a button.

It's the script in the button that's driving me to drink! lol

Any help is greatly appreciated.

The Insert Calculated Result [] script step should do what you want. Be careful with the button placement so that you don't exit the field by clicking it.

  • Author

Thank you.......what would the script you suggest look like, please.

And..."Be careful with the button placement" ..Hmmm..I don't see a way to depress a button without leaving the field.Wow is me......

See the attached example.

InsertCalcResult.fp7.zip

I don't see a way to depress a button without leaving the field.

As a rule, clicking a button does NOT change the current active object. However, if the button is placed in a portal, for example, the context changes and the selection is lost.

  • Author

Thank you for the example download. I'm looking over your download and it's beyond my understanding.

I am looking for a script that will paste the entire contents of a field into another field, exactly starting at the point where the cursor is, in that other feld.

It has to be dooable.....I just cannot see the way to accomplish it.

Any thoughts? If so...an example would be perfect.

I am looking for a script that will paste the entire contents of a field into another field, exactly starting at the point where the cursor is, in that other feld.

Isn't that exactly what my file does? Place your cursor anywhere in the Text field, click the button and the entire contents of the gPhrase field will be inserted at the cursor location.

You don't need script ... Michael used a button (which is like a script that you assign directly to the button); right-click the button (and select 'button setup' to see it). If you insist on a script, make a script with only that same script-step in it instead. :^)

added blue for clarity

Edited by LaRetta

  • Author

Yes indeed it does however I'm looking for text from say Field 1 to be placed into the gPhrase field. I hope I'm explaining it correctly.

To be exact...I have a feld created that has text ( Field 1)...I want whatever I have in (Field 1) to be placed into gPhrase, after the cursor, wherever the cursor is positioned at the time I press the button to activate the script.

What I'm actually seeking is a script that will take whatever is in (Field 1) and place it into gPhrase...but I do not see any scripts in your file.

Am I being clear?...and I do thank you for helping me.....but what you provided is a little beyond my understanding.

LaRetta! !!!!! Thank you, yet again.....gheese LaRetta.....you're the queen of FMForums! !!! :-) Huggers!

.I want whatever I have in (Field 1) to be placed into gPhrase

Just change the names around: the button places whatever you have in gPhrase into the Text field (actually, into any field that happens to contain the cursor)..

I do not see any scripts in your file.

As LaRetta explained, this is a one-liner, so it can be attached directly to the button.

  • Author

I'm working on this now. Thank you both for clarification. :-)

One question though....would a solution also be to use Get(ActiveSelectionstart) ? If so....how would it be accomplished?

  • 3 years later...
  • Newbies

Hi all,

i have same problem!!

As you told field selection gets changed if button is on the portal but unfortunately I need to develop the same functionality and my button should be on portal.

Please help me to develop this

thanks in advance!!

3 hours ago, Challa Ramesh Chowdary said:

 my button should be on portal.

Then you don't have the "same" problem. It would probably be best to start a new thread for this, but in a nutshell: you need to remember the current selection when exiting the target field, and use it in the script attached to the button, that would look like this:

Set Selection [  ... ]
Insert Calculated Result [ ... ]

 

  • Newbies

To use this we should know the position where data should be added and we can get the position by adding script trigger with  Get(ActiveSelectionstart)  function.

If i use this i should commit first but i don't want to do that.

Is there any way to get any other way because my solution environment should be like above attachment .

6 minutes ago, Challa Ramesh Chowdary said:

we can get the position by adding script trigger with  Get(ActiveSelectionstart)  function.

Yes, that and also the Get ( ActiveSelectionSize ) function.

 

6 minutes ago, Challa Ramesh Chowdary said:

If i use this i should commit first

I don't see why. Just trigger the script OnObjectExit attached to your target field.

 

7 minutes ago, Challa Ramesh Chowdary said:

my solution environment should be like above attachment

No, if your buttons are in a portal, then your solution cannot be "like above attachment". I have made this point repeatedly throughout this thread, and also in my first response to you.

 

Create an account or sign in to comment

Important Information

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

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.