Jump to content

Passing a string to NotificationCenter with Run NSApplescript


Recommended Posts

I was encountered a strange problem with my workflow.

I want to use Run NSApplescript to pass a string to NotificationCenter.

So I wrote in Run NSApplescript as follows.

 

set q "foo"

return q

 

And in Post Notification,

 

Text: {query}.

 

But the text field in NotificationCenter is empty.

 

I also tested the case passing a number.

 

ser q 0

return q

 

Then NotificationCenter correctly showed 0 in the text field.

 

What is wrong with the former case?

Link to comment

In that case the notification panel appears and the variable query in Post Notification is empty.

But I don't know the script is working correctly because coding error doesn't prevent appearing a notification panel.

Link to comment
  • 3 months later...

Run Script worked but Run NSAppleScript didn't.

 

 

I'm running the test workflow and I get the same issue.

 

NSApplescript doesn't seem to send anything to the Notification.

 

For the NSAppleScript, the code should be the following...

on alfred_script(q)
  set temp to "sample"
  return temp
end alfred_script
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...