Jump to content

p1r2c1

Member
  • Posts

    5
  • Joined

  • Last visited

Posts posted by p1r2c1

  1. 1 hour ago, deanishe said:

    ^M means carriage return (CR). Those should be line feeds (LF). That is to say, you have the wrong end-of-line character. CR is the old MacOS 9 end-of-line character. macOS 10+ uses LF like all Unixes (Windows uses CRLF). Open the script in a proper code editor (TextMate is very good, and free) and change the script to use Unix line endings (LF).

     

    Ah! Line endings. Those tricky little invisible gremlins. Again, this is something I should have figured out. Thanks @deanishe.

     

    For anyone having this same problem, I found this helpful: http://www.apeth.com/sd5help/indexfolder/referencfolder/faqfolder/lineendings.html

  2. On 8/30/2021 at 2:38 PM, deanishe said:

    Should know is a bit strong unless you're a programmer.

     

    I may be too hard on myself!

     

    In any case, I have run into another problem:

    image.thumb.png.467a81235a9e72732a5007aedda7bb72.png

    It also gives me "error 2" sometimes.

     

    The workflow in question is generated from an AppleScript that gets a selected number of Keyboard Maestro macros and adds them to a JSON script filter. The JSON seems to be valid (JSON Editor opens it without a problem, and it is more fussy than Alfred). I've tried `chmod +x`, launched from the AppleScript and from Terminal. Also, the script won't run from the Alfred script box this time (the window appears but nothing drops down). I've put the script side by side with others that are still working for me and I can't see any meaningful difference.

     

    https://www.dropbox.com/s/zz55r42jvyejwv6/__Script Filter test.alfredworkflow?dl=0

     

    FWIW, tried this on both Catalina and Monterey.

     

    There's probably something very simple that I'm missing again. Trying not to be too hard on myself! :)

  3. I am trying to create a (very) simple JSON script filter that is run as an external script (so that it can be updated by another app). It works perfectly as an internal bash script but not externally.

     

    The non-functioning workflow: [removed as no longer needed]

     

     1848217962_Screenshot2021-08-30at10_50_29.thumb.png.2c79ca6667d900d2f3bd8d607b0fc95f.png

     

    The error message:

    944390414_Screenshot2021-08-30at10_50_18.thumb.png.78e2ebfbef7c453856dc8c829b465a17.png

    Alfred 4.5.1 [1256]

    MacOS 10.15.7

     

    I am guessing that the bash shebang (as has been discussed here) is incomplete, or I'm making some other mistake. I'm just not clear on what Alfred is doing with the script when run internally that it isn't doing when run externally (a newb issue, I'm sure).

     

    Any help would be greatly appreciated.

     

     

×
×
  • Create New...