Skip to content

Instantly share code, notes, and snippets.

@9thbit
9thbit / Join Line With Next.applescript
Last active December 12, 2015 09:49 — forked from gingi/Join Line With Next.applescript
Join lines in BBEdit by placing a space character between the two lines.
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