October 21, 200619 yr Is there some way a script can act on a selected word + the following unselected word ?
October 21, 200619 yr 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
December 22, 200619 yr ... 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?
December 22, 200619 yr 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 December 22, 200619 yr by Guest
Create an account or sign in to comment