Jump to content

Findmoji


rknightuk

Recommended Posts

  • 2 weeks later...

This doesn’t affect inclusion, but the Script Filter can be made faster / with fewer steps.


You’re using bash to call osascript to call script.js which spits out some JSON. First way you could simplify that would be to use External Script instead of /bin/bash and call script.js directly, with the proper shebang (#!/usr/bin/osascript -l JavaScript). But the way simpler method is to leave it as /bin/bash and just do a cat on a JSON file!


In other words, you’re calling osascript with a huge object which the script then converts to a string (the JSON) and outputs it to Alfred, that’s repeated unnecessary computation. By doing it once and saving the JSON file with the workflow, you can simply tell the Script Filter to output the file itself. Less code, fewer resources needed, and faster.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...