Advertisement
Guest User

select word

a guest
May 11th, 2019
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. tell application "CotEditor"
  2.     set theRange to range of selection of document 1
  3.     set beginCharsNum to (first item of theRange) + 1
  4.     set endCharsNum to beginCharsNum + 32
  5.     set textLength to count of characters of rich text of document 1
  6.     if endCharsNum > textLength then set endCharsNum to textLength
  7.     set second item of theRange to count of characters of first item of words of ((characters beginCharsNum thru endCharsNum) of rich text of document 1 as rich text)
  8.     theRange
  9.     set range of selection of document 1 to theRange
  10. end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement