This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "BBEdit" | |
tell window 1 | |
set currentLine to endLine of selection | |
set nextLine to currentLine + 1 | |
-- Delete starting after the last non-whitespace character in the current line | |
set findDeleteStart to find "\\s*$" options {search mode:grep} ¬ | |
searching in line currentLine | |
if found of findDeleteStart then | |
set firstCharacter to characterOffset of found object of findDeleteStart |