Created
June 13, 2014 20:28
-
-
Save thomasjpr/47a22c60d14f29cf7b5d to your computer and use it in GitHub Desktop.
Open BBEdit doc in FoldingText
This file contains 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
-- Open the currently active BBEdit document using FoldingText. | |
tell application "BBEdit" | |
activate | |
-- Ask BBEdit for it's active document. | |
set the_document to active document of text window 1 | |
-- If the file doesn't alreay exist, ask the user to save it. | |
if not the_document's on disk then | |
save the_document | |
end if | |
-- If the file is now on disk, open it using FoldingText. | |
if the_document's on disk then | |
tell application "FoldingText" | |
set the_file to the_document's file | |
open the_file | |
-- Bring FoldingText forward so it becomes visible. | |
activate | |
end tell | |
end if | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment