Jump to content

Want results of a bash script in search area


Recommended Posts

I have a workflow that works and the end action is a post notification. How do I get the end result of the script to appear in the search results? Similar to the attached screenshot.  Is it a specific trigger or notification? Right now I have a:

 

keyword trigger > Script > Post Notification

CleanShot 2024-01-29 at 18.41.28.png

Link to comment

In essence, you have to use a script filter and process the results in JavaScript (in effect creating an array and processing it with JavaScript). Sadly, that's about all the assistance I can provide for I find JavaScript an entirely impenetrable morass (notwithstanding the fact that, with considerable assistance from others, I have included it in a couple of my workflows: for example, my Search files by extension workflow).

 

I think that to obtain much more useful help than I can provide you'd need to share your workflow on some file sharing site (transfer.sh, for example).

 

Sorry not to be as helfpul as others who will doubtless contribute in due course!

 

Stephen

Link to comment
7 hours ago, Stephen_C said:

process the results in JavaScript

 

For reference, it doesn’t have to be JavaScript. While JSON did start from JavaScript, every major language nowadays handles it. At the end of the day it’s just text with a specific structure, you can even write it by hand.

 

6 hours ago, BocciaMan said:

Here is the link

 

In the dte Script Filter, delete the last line and add instead:

 

cat <<EOF
{ "items": [{ "title": "$(get_day_of_week "$input")" }] }
EOF

 

For more information, see Script Filter JSON Format or the Getting Started example workflows (press + on the bottom left, in the workflow list).

Link to comment

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...