Opening Marked 2 from BBEdit

peter2536's Avatar

peter2536

03 Jun, 2018 04:38 AM

Brett,

You were kind enough to send me an Apple script to open MultiMarkdown documents from BBEdit.

The script was:

tell application "BBEdit" to set mdFile to file of document window 1
tell application "Marked 2"
activate open mdFile end tell

I followed your instructions but when I run the script I get a -1702 error (corrupt document)

I have attached two screenshots and the original md file. Could you please advise how I can fix this error. I've tried Google but can't find anything relevant.

Regards,
Peter

  1. Support Staff 1 Posted by Brett on 03 Jun, 2018 12:22 PM

    Brett's Avatar

    Try downloading this directly, unzipping, and placing into the BBEdit
    Scripts folder (~/Library/Application Support/BBEdit/Scripts). You don't
    need to open it in Script Editor at all, it will run with the
    "applescript" extension as an uncompiled script.

    https://d.pr/free/f/ou4jbt

    -Brett

  2. 2 Posted by peter2536 on 03 Jun, 2018 03:01 PM

    peter2536's Avatar

    Brett,

    Thank you again for your help. The new script works fine. BBEdit and Marked 2 are (IMHO) the best Markdown writing combination. I use a number of snippets in BBEdit to make life easier.

    Answer this only if you have time; the two scripts are the same except for the second being an AppleScript. Is the script file being a *.applescript file rather than a *.scpt file?

    Thanks again,
    Peter

    Peter Anderson
    There is nothing more difficult to take in hand, more perilous to conduct, or more uncertain in its success, than to take the lead in the introduction of a new order of things — Niccolo Machiavelli, The Prince, ch. 6

  3. 3 Posted by Robert on 03 Jun, 2018 04:41 PM

    Robert's Avatar

    Hello!

    with a change it works for me also for CotEditor, really cool! Great, thanks...

    -- Place in ~/Library/Application Support/com.coteditor.CotEditor
    -- Use from the Script menu bar item while editing a Markdown document (must be saved first)
    tell application "CotEditor" to set mdFile to file of document of window 1
    tell application "Marked 2"
        activate
        open mdFile
    end tell
    

    Best regards Robert

  4. peter2536 closed this discussion on 01 Jun, 2023 01:59 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac