kapps Posted May 31, 2014 Share Posted May 31, 2014 hey guys, The actions that are displayed within a workflow is what I'd like to specifically execute from Applescript. Is this possible for alfred or should I look at a different approach. Thanks Link to comment
Carlos-Sz Posted May 31, 2014 Share Posted May 31, 2014 If I get it right then maybe you should look for workflow External Trigger. My Pinboard workflow makes use of it. From an external script you can call preload keyword without showing Alfred itself. Link to comment
jdfwarrior Posted June 1, 2014 Share Posted June 1, 2014 hey guys, The actions that are displayed within a workflow is what I'd like to specifically execute from Applescript. Is this possible for alfred or should I look at a different approach. Thanks Depending on what your looking to accomplish, Alfred supports the "search" action and "run trigger". Telling Alfred to search simply displays him and populates the textbox with whatever you tell it to Example: tell application "Alfred 2" to search "this is a test" You could also set up external triggers to make Alfred perform a direct call to an action using "run trigger". You would need to set up an external trigger in your workflow that connected to the action to be run. At that point, Alfred provides you with sample code for running that trigger via Applescript Link to comment
kapps Posted June 2, 2014 Author Share Posted June 2, 2014 Thanks guys. I am new to alfred so trying to make this work. The workflow is lifx.https://github.com/stroebjo/alfred-lifx/blob/master/README.md Using either the hotkey or the applescript generated from external trigger, I am able to list the resultant possible actions within the workflow but I am not sure how to nominate a pre-existing action without the use of gui scripting within applescript which would make it unpredictable. Link to comment
jdfwarrior Posted June 3, 2014 Share Posted June 3, 2014 Thanks guys. I am new to alfred so trying to make this work. The workflow is lifx.https://github.com/stroebjo/alfred-lifx/blob/master/README.md Using either the hotkey or the applescript generated from external trigger, I am able to list the resultant possible actions within the workflow but I am not sure how to nominate a pre-existing action without the use of gui scripting within applescript which would make it unpredictable. I dont have a way to test this so I'm not sure what exactly I'm supposed to get from it but..With the external trigger or with just plain old applescript, if the results can be filtered to something that you KNOW is there.. you could just hard code passing that value into alfred in the script then using a hotkey to call that Link to comment
rice.shawn Posted June 3, 2014 Share Posted June 3, 2014 Don't be afraid with a level of code duplication when it comes to this problem. You can have the regular workflow, but you could also have an external trigger that leads to a workflow object that is a 'run script' that is also taken care of in the normal course of events. While this isn't the best option, it's by no means frowned upon (as long as I'm the one who tells people when to frown, which really isn't the case). External triggers can be great to accomplish something, but if you've written most of the workflow in a script filter, then you should rewrite part of it as a different workflow object to accept an argument and carry out an action as necessary. 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