Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tell application "CotEditor"
- set theRange to range of selection of document 1
- set beginCharsNum to (first item of theRange) + 1
- set endCharsNum to beginCharsNum + 32
- set textLength to count of characters of rich text of document 1
- if endCharsNum > textLength then set endCharsNum to textLength
- 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)
- theRange
- set range of selection of document 1 to theRange
- end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement