Jump to content

Sending custom text to an output Notification


Recommended Posts

I have a workflow currently that takes a script input, sends it to an Action -> Run Script, and I want this to post a notification to the user depending on whether the action on the script was successful. It's an authentication script.

 

Using David Ferguson's very helpful library, I have this script, which I was hoping as I'd passed a string to the $arg parameter of the result method, this would be passed along to the notification, but it's not happening. This window keeps telling me that I need to do something with "{query}" but I don't know how to do this on output and I can't find a sample script that sends custom text to a notification so I'm a bit stuck now! Can anyone advise on how I send custom text to a notification in this way?

 

Thanks!

Edited by jaspertandy
Link to comment

I have a workflow currently that takes a script input, sends it to an Action -> Run Script, and I want this to post a notification to the user depending on whether the action on the script was successful. It's an authentication script.

 

Using David Ferguson's very helpful library, I have this script, which I was hoping as I'd passed a string to the $arg parameter of the result method, this would be passed along to the notification, but it's not happening. This window keeps telling me that I need to do something with "{query}" but I don't know how to do this on output and I can't find a sample script that sends custom text to a notification so I'm a bit stuck now! Can anyone advise on how I send custom text to a notification in this way?

 

Thanks!

 

I was a good ways into a thought/reply when I realized something. The library that you are using of mine is for generating XML output for use in a Script Filter, not a Run Script. Script Filter's allow you to generate results and have them shown in Alfred. You can then select those results and do something with them. For a regular Run Script, you would just need to Run the script that have and then 'echo' the output. From a notification output item, you would then put {query} in the text somewhere to show the output of the script.

 

For instance, if in my script, I did.. echo "this is a test"; Then if I set the text of the notification to "Hey {query}" it would show, "Hey this is a test"

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