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.

script to grab selected word plus next unselected word?

Featured Replies

Is there some way a script can act on a selected word + the following unselected word ?

Middle( text ; Get ( ActiveSelectionStart ) ; Get ( ActiveSelectionSize )) gives the text of the selection.

LeftWords(

Right( text ; Length( text ) - Get ( ActiveSelectionStart ) - Get ( ActiveSelectionSize ))

; 1)

give the following word. If nothing is selected it gives the first word.

-jens

  • 2 months later...
  • Author

i don't think your suggestion is correct.. is it ?

... Sounds right...

Middle( textField ; Get ( ActiveSelectionStart ) ; Get ( ActiveSelectionSize )) & " " &

LeftWords(

Right( textField ; Length( textField ) - Get ( ActiveSelectionStart ) - Get ( ActiveSelectionSize ))

; 1)

... should work exactly as you want .. pretty smart too, would've taken me like half an hour to work that one out.

Why don't you test it and tell us if it works?

It is correct in the sense that it gets the FOLLOWING word, as stated. If you want the selected word AND the following word, you can change it to:

LeftWords ( Right ( text ; Length ( text ) - Get ( ActiveSelectionStart ) + 1 ) ; 2 )

---

Note that this assumes that the selection starts at the beginning of a word, or that the cursor is at the beginning of a word.

Edited by Guest

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.