Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BBEditDocumentType</key>
<string>CodelessLanguageModule</string>
<key>BBLMColorsSyntax</key> <true/>
<key>BBLMIsCaseSensitive</key> <false/>
<key>BBLMLanguageCode</key>
<string>Ldgr</string>
@mixio
mixio / run_jq.applescript
Last active February 1, 2020 08:33
Applescript for json transform with jq in BBEdit
--
on escape_new_lines(aText)
set vDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {"\\n", "\\r"}
set vParts to (text items of aText)
set AppleScript's text item delimiters to {"\\\\n"}
set vResult to (items of vParts) as string
set AppleScript's text item delimiters to vDelims
return vResult
end escape_new_lines
@mixio
mixio / entities_canonize_diacritics.txt
Created February 25, 2021 19:14
file used to convert diacritic characters to html entities with the canonize utility of BBEdit
# -*- x-bbedit-canon-case-sensitive: 1; x-bbedit-canon-match-words: 0; x-bbedit-canon-grep: 1; -*-
À \&Agrave;
Á \&Aacute;
 \&Acirc;
à \&Atilde;
Ä \&Auml;
Å \&Aring;
Æ \&AElig;
Ç \&Ccedil;
È \&Egrave;
@mixio
mixio / open_bbedit_selection_with_terminal.applescript
Last active March 14, 2021 17:12
AppleScript for BBEdit that tries to use the selected text as a path or paths to files to open with the help of the terminal. This script should be compiled as an .scpt script before use.
# Author: Jean Jourdain
# © 2021, mixio.com
# License: MIT
--
use AppleScript version "2.7"
use scripting additions
use framework "Foundation"
--
property NSString : class "NSString"
property NSCharacterSet : class "NSCharacterSet"
@mixio
mixio / adapt_tab_width_to_bbedit_csv_tsv_contents.applescript
Created June 10, 2021 10:38
BBEdit script to set the tab width of a CSV or TSV document to the size of the longest field in order to view data "in aligned columns"
# This script will use the `xsv` command line tool:
# <https://github.com/BurntSushi/xsv>
# to compute the max length of all cells of columns from 1 to n - 1 of
# the front document of BBEdit if it is a CSV of TSV file with
# respective extensions of '.csv' and '.tsv'.
# It will then set the tab width of the document to this max length,
# allowing the user to view the data in aligned columns.
# For that purpose, in CSV files a tab will be inserted
# after each comma separator when required.
tell application "BBEdit"
@mixio
mixio / open_link_copied_to_clipboard_in_BBEdit.applescript
Created June 29, 2021 12:06
Run this script to have the contents of a link copied to the clipboard, downloaded into a new BBEdit document.
@mixio
mixio / test_process_pdfs.applescript
Last active July 4, 2021 20:08
This is a sample script showing how to process a directory of PDF files: 1) Extract PDF's text. 2) Create a BBEdit document with it.
--
use AppleScript version "2.7"
use scripting additions
use framework "Foundation"
--
property NSString : class "NSString"
property NSURL : class "NSURL"
property PDFDocument : class "PDFDocument"
property NSCharacterSet : class "NSCharacterSet"
--
@mixio
mixio / emmet_expand_css_abbreviation.applescript
Last active November 12, 2021 17:10
This BBEdit applescript will try to expand css abbreviations using Emmet.
##
# README
#
# This script will try to expand Emmet css abbreviations.
# If nothing is selected in the frontmost document,
# it will use the expression at the left of the insertion point
# otherwise it will use the selected expression.
#
# See: https://github.com/emmetio/emmet
#
@mixio
mixio / 0-[⌘…]-[compare_extracts]-[1]-[open_differences_window].applescript
Created December 12, 2021 11:33
BBEdit scripts to diff two front windows' selections
(*
FILENAME:
0-[⌘…]-[compare_extracts]-[1]-[open_differences_window].applescript
README:
This script:
• extracts the selection of the two frontmost windows to two new temporary documents;
• names the temporary documents with the name of the original documents with identification metadata appended;
@mixio
mixio / 0-[⌘…]-[underline_selection].applescript
Last active January 9, 2022 16:32
Adds a p͇s͇e͇u͇d͇o͇ ͇u͇n͇d͇e͇r͇l͇i͇n͇e͇ ͇s͇t͇y͇l͇e͇ to BBEdit
(*
README:
This scrit is a bit of a hack that takes advantage of Unicode combining
codepoints to create a p͇s͇e͇u͇d͇o͇ ͇u͇n͇d͇e͇r͇l͇i͇n͇e͇ ͇s͇t͇y͇l͇e͇.
It works by inserting the combining underline codepoint (U+0347 COMBINING EQUALS
SIGN BELOW) after each character of the selection, skipping linefeeds.