Loading ...
Sorry, an error occurred while loading the content.

Re: Script for viewing markdown in Marked

Expand Messages
  • Michael
    For reasons not entirely clear to me, the script will hang on some files (naturally, none I tested before posting about it!), with SubEthaEdit waiting for a
    Message 1 of 2 , Aug 2, 2011
    View Source
    • 0 Attachment
      For reasons not entirely clear to me, the script will hang on some files (naturally, none I tested before posting about it!), with SubEthaEdit waiting for a response from Marked. Adding an <code>ignoring application responses</code> takes care of that. Sorry for any inconvenience.

      Here's the revised script:

      tell application "SubEthaEdit"
      if not (exists path of front document) then
      error "You have to save the document first"
      end if
      set docpath to the path of the front document
      end tell

      set mdFile to POSIX file docpath
      ignoring application responses
      tell application "Marked" to open mdFile
      end ignoring

      on seescriptsettings()
      return {displayName:"Preview with Marked", shortDisplayName:"Preview", keyboardShortcut:"@O", toolbarIcon:"ToolbarIconRun", inDefaultToolbar:"yes", toolbarTooltip:"Preview current document with Marked", inContextMenu:"no"}
      end seescriptsettings
    Your message has been successfully submitted and would be delivered to recipients shortly.