Cannot get Fountain Support to work

Adam Schoales's Avatar

Adam Schoales

01 May, 2012 02:42 AM

Using the most up to date instructions on the Candler Blog I cannot get fountain documents to show up in the app - they always appear as blank. I then tried downloading a fountain doc from their site (thinking maybe mine was somehow wrong) and it caused Marked to crash.

I've tried SEVERAL times now. I've even uninstalled the app and reinstalled everything from scratch to try and get it working again but cannot.

Any help anyone could offer would be GREATLY appreciated! I really want to start using fountain for screenplay use (it'd actually get me writing more) but until I can get it actually working in an app I'm stalled.

  1. Support Staff 1 Posted by Brett on 01 May, 2012 03:19 AM

    Brett's Avatar

    Hi Adam,

    Before we start debugging, can you tell me what your comfort level with the command line/Terminal is? I just need to know how much detail to include in my questions/instructions.

  2. 2 Posted by Adam Schoales on 01 May, 2012 03:33 AM

    Adam Schoales's Avatar

    I've done a bit of tinkering here and there - certainly can copy and paste commands. But I'm no expert. I came to the mac in the OS X days so Command Line has never been a major need for me.

    But I'm willing to give anything a shot ;)

  3. Support Staff 3 Posted by Brett on 01 May, 2012 12:50 PM

    Brett's Avatar

    Ok, so I need to know if the command you're using gives you output on the command line first. Copy the path you have in the custom processor field, then go to Terminal run:

    `cat path/to/a/file.fountain | the/command/path`

    Without any backticks, and where path/to/a/file.fountain is a fountain file. If it were on your desktop the path would be ~/Desktop/file.fountain, for example. Do you get HTML as a result of the command?

  4. 4 Posted by Adam Schoales on 02 May, 2012 02:28 AM

    Adam Schoales's Avatar

    Okay so here's what I put:

    > cat ~/Desktop/BigFish.fountain | /Users/adamschoales/Library/Application\ Support/Marked/screenplain-marked/screenplain_marked.sh
    (got this by dragging the actual screenplain_marked.sh file into terminal) and the terminal output was

    > -bash: /Users/adamschoales/Library/Application Support/Marked/screenplain-marked/screenplain_marked.sh: /bin/bash: bad interpreter: Operation not permitted

    I then tried dragging typing cat and dragging both the fountain file into terminal (to get it to fill in all the info itself) added the | and then dragged the screenplain unix executable to get the proper director and got the following:

    > Zaphod:~ adamschoales$ cat /Users/adamschoales/Desktop/BigFish.fountain | /Users/adamschoales/Library/Application\ Support/Marked/screenplain-marked/bin/screenplain
    > -bash: /Users/adamschoales/Library/Application Support/Marked/screenplain-marked/bin/screenplain: /usr/bin/env: bad interpreter: Operation not permitted

    Maybe I'm doing something wrong in terminal, I don't know... I'm so lost it's not even funny...

    On 2012-05-01, at 8:50 AM, Brett wrote:

    > |

  5. Support Staff 5 Posted by Brett on 02 May, 2012 02:43 AM

    Brett's Avatar

    2 questions, then:

    What is the first line of the sh file, and have you made it executable? (chmod a+x "/Users/adamschoales/Library/Application Support/Marked/screenplain-marked/screenplain_marked.sh")

  6. 6 Posted by Adam Schoales on 02 May, 2012 03:02 AM

    Adam Schoales's Avatar

    The script looks as follows (hasn't been changed from the original download)

    > #!/bin/bash
    > # This shell script points to your installation of screenplain. By default it is set to `~/Library/Application\ Support/Marked/screenplain-marked/bin/screenplain`. If you place the complete `marked-screenplain` folder into `~/Library/Application Support/Marked` then you should not need to edit this script.
    > # If the script is not working, you should open Terminal (located in `Applications/Utilities`) and make the file executable by typing `chmod a+x /path/to/screenplain_marked.sh `
    >
    > cat | ~/Library/Application\ Support/Marked/screenplain-marked/bin/screenplain --format html --bare - -

    I had tried the chmod before but DIDN'T have it in quotations (before when I tried to run it it did nothing).

    Trying that I got the following results:

    > Zaphod:~ adamschoales$ chmod a+x "/Users/adamschoales/Library/Application\ Support/Marked/screenplain-marked/screenplain_marked.sh"
    > chmod: /Users/adamschoales/Library/Application\ Support/Marked/screenplain-marked/screenplain_marked.sh: No such file or directory
    > Zaphod:~ adamschoales$

    *sigh*

  7. Support Staff 7 Posted by Brett on 02 May, 2012 02:20 PM

    Brett's Avatar

    Yeah, the quotes and the backslash in Application Support are
    redundant, you only need one or the other. To check if it's already
    executable, do

    ls -l ~/Library/Application\ Support/Marked/screenplain-marked/bin/screenplain

    Let me know what that gets you. Also please paste the exact text you
    have in the custom processor field. We'll figure this out, I promise
    :).

  8. 8 Posted by Adam Schoales on 03 May, 2012 03:19 AM

    Adam Schoales's Avatar

    Ran that command and got:

    > -rwxr-xr-x@ 1 adamschoales staff 241 1 Mar 10:46 /Users/adamschoales/Library/Application Support/Marked/screenplain-marked/bin/screenplain

    Also, here's what I've got in my custom processor:

    > /Users/adamschoales/Library/Application Support/Marked/screenplain-marked/screenplain_marked.sh

    Thanks for you help!!

  9. Support Staff 9 Posted by Brett on 04 May, 2012 01:02 PM

    Brett's Avatar

    Ok, run this for me in Terminal, substituting /yourfile.fountain with a fountain document you can test with. You'll need the full path to the document:

     cat yourfile.fountain | "/Users/adamschoales/Library/Application Support/Marked/screenplain-marked/screenplain_marked.sh"
    

    You should get HTML output in Terminal if that works. Let me know.

  10. 10 Posted by Adam Schoales on 04 May, 2012 11:51 PM

    Adam Schoales's Avatar

    Alright here we go...

    > Zaphod:~ adamschoales$ cat /Users/adamschoales/Desktop/BigFish.fountain | "/Users/adamschoales/Library/Application Support/Marked/screenplain-marked/screenplain_marked.sh"
    > /Users/adamschoales/Library/Application Support/Marked/screenplain-marked/screenplain_marked.sh: /Users/adamschoales/Library/Application Support/Marked/screenplain-marked/bin/screenplain: /usr/bin/env: bad interpreter: Operation not permitted

  11. Support Staff 11 Posted by Brett on 05 May, 2012 12:28 AM

    Brett's Avatar

    Ok. Does the first line of your shell script start with #!/usr/bin/env? Sounds like we need to change that first. I'll take a look at the default script when I'm back to my computer and send you a revision.

    -Brett (on iPhone)

  12. 12 Posted by Adam Schoales on 05 May, 2012 01:46 AM

    Adam Schoales's Avatar

    No it seems to start with

    > #!/bin/bash

    the complete contents are as follows:

    > #!/bin/bash
    > # This shell script points to your installation of screenplain. By default it is set to `~/Library/Application\ Support/Marked/screenplain-marked/bin/screenplain`. If you place the complete `marked-screenplain` folder into `~/Library/Application Support/Marked` then you should not need to edit this script.
    > # If the script is not working, you should open Terminal (located in `Applications/Utilities`) and make the file executable by typing `chmod a+x /path/to/screenplain_marked.sh `
    >
    > cat | ~/Library/Application\ Support/Marked/screenplain-marked/bin/screenplain --format html --bare - -

  13. Support Staff 13 Posted by Brett on 07 May, 2012 08:05 PM

    Brett's Avatar

    Sorry for the delayed response.

    That's exactly how it should start, turns out it's the screenplain executable that calls env. So, rather than hack apart the Python application, we'll need to figure out why env isn't working for you.

    It's either env, or a bad python installation. On your command line, type:

    /usr/bin/env python
    

    Let me know what you see. It should open the Python command line interpreter, but I have a feeling you're going to get an error. If you do, type:

    /usr/bin/python
    

    If that works, it's probably an issue with paths that we can solve with one line in the shell script.

    export PATH=/usr/bin:$PATH
    

    Let me know if that gets you anywhere.

  14. 14 Posted by Adam Schoales on 07 May, 2012 08:20 PM

    Adam Schoales's Avatar

    Adding to the mystery...

    > Zaphod:~ adamschoales$ /usr/bin/env python
    > Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05)
    > [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
    > Type "help", "copyright", "credits" or "license" for more information.
    > >>>

  15. Support Staff 15 Posted by Brett on 07 May, 2012 08:50 PM

    Brett's Avatar

    So it's likely a problem with your path disappearing when Marked runs the script. Try adding the `export` command before the call to screenplain in your script.

  16. 16 Posted by Adam Schoales on 08 May, 2012 01:27 AM

    Adam Schoales's Avatar

    So it should look like this?

    > #!/bin/bash
    > # This shell script points to your installation of screenplain. By default it is set to `~/Library/Application\ Support/Marked/screenplain-marked/bin/screenplain`. If you place the complete `marked-screenplain` folder into `~/Library/Application Support/Marked` then you should not need to edit this script.
    > # If the script is not working, you should open Terminal (located in `Applications/Utilities`) and make the file executable by typing `chmod a+x /path/to/screenplain_marked.sh `
    >
    > export cat | ~/Library/Application\ Support/Marked/screenplain-marked/bin/screenplain --format html --bare - -

    I tried that and doesn't seem to be doing anything... I cannot fathom what I'm doing wrong here... haha

  17. Support Staff 17 Posted by Brett on 08 May, 2012 02:02 AM

    Brett's Avatar

    Oops, no, I meant the full export command I posted above

     export PATH=/usr/bin:$PATH
    

    on its own line before cat |...

  18. 18 Posted by Adam Schoales on 08 May, 2012 02:57 AM

    Adam Schoales's Avatar

    Crud, still nothing.

    This is what it looks like currently.

    > #!/bin/bash
    > # This shell script points to your installation of screenplain. By default it is set to `~/Library/Application\ Support/Marked/screenplain-marked/bin/screenplain`. If you place the complete `marked-screenplain` folder into `~/Library/Application Support/Marked` then you should not need to edit this script.
    > # If the script is not working, you should open Terminal (located in `Applications/Utilities`) and make the file executable by typing `chmod a+x /path/to/screenplain_marked.sh `
    >
    > export PATH=/usr/bin:$PATH
    >
    > cat | ~/Library/Application\ Support/Marked/screenplain-marked/bin/screenplain --format html --bare - -

  19. Support Staff 19 Posted by Brett on 08 May, 2012 10:35 AM

    Brett's Avatar

    Try this, just to be sure all of this is necessary:

    Go into Preferences->Behavior and change the Custom Processor line to:

     ~/Library/Application Support/Marked/screenplain-marked/bin/screenplain
    

    (no slashes or quotes). Leave the arguments field blank and save. If that doesn't work, add --format html --bare - - to the arguments. If still no go, check Console.app and see if you're still getting the env error message.

    Sorry this is taking so much work to figure out, I haven't seen this error crop up on anyone else's system before...

  20. 20 Posted by Adam Schoales on 08 May, 2012 12:42 PM

    Adam Schoales's Avatar

    Doesn't seem to have done it...

    With no arguments:

    > 12-05-08 8:36:53.300 AM Marked: *** NSTask: Task create for path '/Users/adamschoales/Library/Application Support/Marked/screenplain-marked/bin/screenplain' failed: 22, "Invalid argument". Terminating temporary process.

    with arguments:

    > 12-05-08 8:37:41.073 AM Marked: *** NSTask: Task create for path '/Users/adamschoales/Library/Application Support/Marked/screenplain-marked/bin/screenplain' failed: 22, "Invalid argument". Terminating temporary process.

    And here's the MOST interesting part - there are a few of these in the console...

    > 12-05-08 8:37:07.224 AM ReportCrash: Saved crash report for Marked[24296] version ??? (???) to /Users/adamschoales/Library/Logs/DiagnosticReports/Marked_2012-05-08-083707_Zaphod.crash

    here it is again after changing arguments:

    > 12-05-08 8:38:43.032 AM ReportCrash: Saved crash report for Marked[24325] version ??? (???) to /Users/adamschoales/Library/Logs/DiagnosticReports/Marked_2012-05-08-083843_Zaphod.crash

    So it looks like something IS going on... it's just WHAT I have no idea...

    Maybe we need to do a remote desktop session or something so you can attempt to check everything you need to check and make sure I'm not missing something. It's really strange, but I think those have something to do with it...

  21. Support Staff 21 Posted by Brett on 08 May, 2012 01:05 PM

    Brett's Avatar

    Can you send me the last crash report? (/Users/adamschoales/Library/Logs/DiagnosticReports/Marked_2012-05-08-083843_Zaphod.crash). It's probably crashing because of the NSTask error, but does Marked actually quit or freeze when you see that message?

    If you're willing, we can set up an SSH session and I can just work in Terminal to see where things are at. A screenshare may be needed after that to check Marked settings, but an SSH terminal session would be the easiest way for me to see what errors are happening. Let me know what you think. I can contact you off-board with AIM and email info for sharing details.

  22. 22 Posted by Adam Schoales on 09 May, 2012 11:36 AM

    Adam Schoales's Avatar

    Here's the crash report:

    [[Edited...]]]

    I'm cool with doing an SSH session. Just let me know the details.

  23. Support Staff 23 Posted by Brett on 09 May, 2012 12:03 PM

    Brett's Avatar

    So does Marked spin or crash when you get that message, or does it just happen in the background?

    I'll contact you by email today to set up the credentials to get me over SSH in so I can see that everything's working on the backend. We'll go from there.

  24. 24 Posted by Adam Schoales on 09 May, 2012 01:58 PM

    Adam Schoales's Avatar

    That's the weird part... it doesn't crash or anything. It's very bizarre.

  25. Support Staff 25 Posted by Brett on 09 May, 2012 02:08 PM

    Brett's Avatar

    It's because it's the background render task that's crashing, not Marked itself. The script is returning an error that NSTask can't handle. It's handy to know, I can probably put in a failsafe and visible error message for that, but it doesn't really solve anything for us. We'll get there, thanks for your amazing patience :).

  26. Support Staff 26 Posted by Brett on 17 May, 2012 12:18 PM

    Brett's Avatar

    Posting for posterity:

    The issue turned out to be that the screenplain install had converted to DOS newlines and couldn't be read by Python. I'll make sure that the download isn't causing this from the start, but if you run into it... Change to the directory where the screenplain folder is located, and from one level below the screenplain folder, run:

     zip -qr sp.zip screenplain && unzip -aqo sp.zip && rm sp.zip
    

    Should do the trick.

  27. Brett closed this discussion on 17 May, 2012 12:18 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