Last night I had a crash in BBEdit (unusual). Usually BBEdit restarts exactly as it quit with all documents saved or not. Unfortunately this particular crash hosed the document-state, and I lost some work. Nothing too important as the non-transient stuff was saved.
In any case the incident prompted me to do something I've been meaning to get to - I finally wrote a script to open all Recent Items.
I have a Keyboard Maestro macro that actually opens the Recent Items menu for quick access, but I didn't want to open a bunch of items piecemeal.
This thing needs more intelligence, but it's not bad as a first effort.
--------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2014/09/12 16:08
# dMod: 2014/09/12 16:08
# Appl: BBEdit
# Task: Open All Existing Recent Items.
# Libs: None
# Tags: @Applescript, @Script, @BBEdit, @Open, @Recent, @Items
--------------------------------------------------------------------------
set fileStillExistingList to {}
set shCmd to "#! /usr/bin/env bash
defaults read com.barebones.bbedit \\
| sed -En '/ *\"RecentItems:ItemData\" =/, / *RecentOpenByNameStrings =/{
/ * Folder =/,/ * Project =/d
/TextTransform =/,/\"RecentItems:ItemData\" =/d
/FileURL = /{
s/ *FileURL = //
s/\"//g
s/;$//
p
}
}';
"
set fileList to do shell script shCmd
set fileList to paragraphs of fileList
repeat with i in fileList
try
set end of fileStillExistingList to absoluteURL i as alias # Satimage.osax
end try
end repeat
tell application "BBEdit"
open fileStillExistingList
end tell
--------------------------------------------------------------------------