Olaf Posted January 15, 2013 Share Posted January 15, 2013 Hi, I can not find a way to access the actual keyword entered if a workflow is triggered by a keyword input. I can only get the arguments via {query}. Getting the argument would allow to handle multiple keyword commands in a single script. For a simple example, suppose I want to process and then add items to either a "work" and "home" folder. Currently, unless I want to duplicate my script, I can use a single keywork "add" and the must specify the destination as the first argument, for example: "add h item1 item2" (to add items to "home" folder) "add w item1 item2! (to add items to "work" folder) But if it was possible to access the keyword from a query I could use "addh item1 item2" (to add items to "home" folder) "addw item1 item2! (to add items to "work" folder) Any throught or ideas? Cheers, Olaf Link to comment
Florian Posted January 15, 2013 Share Posted January 15, 2013 Just make two of them. Different keywords, different outcomes, sounds like a separate script to me. Link to comment
Olaf Posted January 15, 2013 Author Share Posted January 15, 2013 Just make two of them. Different keywords, different outcomes, sounds like a separate script to me. Sure, that would be possible, but it would mean to duplicate code: in the example above, suppose you want to do a some processing on the items, regradless of the destination being "home" or "work". Link to comment
Florian Posted January 15, 2013 Share Posted January 15, 2013 What about setting the argument to no space ? Link to comment
jdfwarrior Posted January 15, 2013 Share Posted January 15, 2013 Setting no space shouldn't do it, it is still going to match the keyword and only pass whatever comes after the keyword. I don't believe there is going to be a way to grab the keyword. By 'do some processing on them' what are you meaning? Because technically you could still do as Florian suggested and create multiple keywords for entering, but then link each keyword to a single action, or to a single action based on a specific modifier key. Link to comment
OliverJAsh Posted January 18, 2013 Share Posted January 18, 2013 I've also found that I just need this. It would be nice so that I don't have to duplicate code. http://www.alfredforum.com/index.php?/topic/249-get-keyword-in-applescript/ Link to comment
JonB Posted January 18, 2013 Share Posted January 18, 2013 It would be great to be able to grab the keyword as well as the query. Would allow me to integrate with my bug tracker in the following way: Entering "bugticket-123" would just open my bug ticket, but I need the bugticket bit (my keyword) as well as the -123. There would by multiple keywords to trigger this. 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