-------------------------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2014/11/11 23:25
# dMod: 2014/11/11 23:42
# Appl: AppleScript-Runner ; Shell ; BBEdit
# Task: Export AppleScript Library Text to BBEdit
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @BBEdit, @Export, @Library, @Text
# Test: OSX 10.9.5
-------------------------------------------------------------------------------------------
set shCmd to text 2 thru -2 of "
#! /usr/bin/env bash
cd ~/'Library/Script Libraries/';
for i in `ls -d *Lb*` # Filter by name to only primary libraries.
do
libText+=\"\\n•• Library $i Begins ••\\n`osadecompile $i`\\n•• Library $i Ends ••\\n\"
done
echo \"$libText\";
"
set applescriptLibraryText to do shell script shCmd
bbeditNewDoc(applescriptLibraryText, true)
-------------------------------------------------------------------------------------------
--» HANDLERS
-------------------------------------------------------------------------------------------
on bbeditNewDoc(_text, _activate)
tell application "BBEdit"
set newDoc to make new document with properties {text:_text, bounds:{0, 44, 1920, 1200}}
tell newDoc
select insertion point before its text
end tell
if _activate = true or _activate = 1 then activate
end tell
end bbeditNewDoc
-------------------------------------------------------------------------------------------