syno Posted March 19, 2014 Share Posted March 19, 2014 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
Tyler Eich Posted March 19, 2014 Share Posted March 19, 2014 I'm not sure why the second one works… I do know your AppleScript should read `set q to "query"`. Your second declaration should likewise read `set q to 0` Link to comment
syno Posted March 19, 2014 Author Share Posted March 19, 2014 Thanks Tyler Eich. You are right. They are just my typos. The correct scripts I wrote are set q to "foo" or set q to 0. The first one didn't work as I wish. Link to comment
Tyler Eich Posted March 19, 2014 Share Posted March 19, 2014 Thanks Tyler Eich. You are right. They are just my typos. The correct scripts I wrote are set q to "foo" or set q to 0. The first one didn't work as I wish. So everything works now? Link to comment
syno Posted March 19, 2014 Author Share Posted March 19, 2014 No. set q to "foo" don't work. Strictly speaking, the query which Post Notification receive is empty. Link to comment
Tyler Eich Posted March 19, 2014 Share Posted March 19, 2014 No. set q to "foo" don't work. Strictly speaking, the query which Post Notification receive is empty. Does your code read like this?: on alfred_script(q) set q to "query" return q end alfred_script Link to comment
syno Posted March 20, 2014 Author Share Posted March 20, 2014 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
Tyler Eich Posted March 20, 2014 Share Posted March 20, 2014 Try this workflow: http://cl.ly/0B3K473u3F2q Let me know if it works! Link to comment
syno Posted March 21, 2014 Author Share Posted March 21, 2014 Run Script worked but Run NSAppleScript didn't. Link to comment
khaosspawn Posted July 10, 2014 Share Posted July 10, 2014 I'm running the test workflow and I get the same issue. NSApplescript doesn't seem to send anything to the Notification. Link to comment
jdfwarrior Posted July 11, 2014 Share Posted July 11, 2014 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now