Created
October 25, 2013 15:21
-
-
Save nickwynja/7156426 to your computer and use it in GitHub Desktop.
Open in Marked
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
try | |
tell application "BBEdit" | |
if front window exists then | |
if class of front window is not in {shell window, scratchpad_window} then | |
tell front text document of front window | |
if its file ≠ missing value then | |
set frontTextDoc to its file as alias | |
else | |
error "The Front Text Document Is Unsaved!" | |
end if | |
end tell | |
else | |
error "Front Window Is NOT A Text Document!" | |
end if | |
else | |
error "No Windows Are Open!" | |
end if | |
end tell | |
tell application "Marked" | |
activate | |
open frontTextDoc | |
end tell | |
on error errMsg number errNum | |
set sep to "==============================" | |
set e to sep & return & "Error: " & errMsg & return & sep & return ¬ | |
& "Error Number: " & errNum & return & sep | |
beep | |
display dialog e | |
end try |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment