Advertisement
Guest User

Select word

a guest
May 12th, 2019
154
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 beginCharNum to (first item of theRange) + 1
  4.     set endCharNum to beginCharNum + 32
  5.     set textLength to count of characters of rich text of document 1
  6.     if endCharNum > textLength then set endCharNum to textLength
  7.     set second item of theRange to count of characters of first item of words of ((characters beginCharNum thru endCharNum) of rich text of document 1 as rich text)
  8.     set range of selection of document 1 to theRange
  9. end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement