Hi folks,
I am working on a Alfred workflow that will have elements in different levels to browse through. I would like to call a workflow and show (and filter) the first level elements, then, when choosing one of these elements I want to list (and filter) the sub-elements below this specific top-level element, and so on. At every of the elements I would like to have a secondary option which allows me to do other things with this element instead of jumping into the sub-elements (cmd-click).
I now have several questions on which could be the best practices for that to achieve:
I have found it very practical to pass the selected element as a „autocomplete“ argument and set the „validity“ to „no“, so when selecting an element, I can pass this one to the very same workflow and display its sub-elements. Very nice, because the Alfred dialog doesn’t disappear from the screen, it just refreshes nicely etc. Unfortunately, when using this variant I have no possibility to go further in the workflow, for example using the cmd-click to do „other things“ with this object. Is there a way to combine these two?
Another way of calling one workflow from within itself is an AppleScript:
—
tell application „Alfred 2“
search „mykeyword „
end tell
—
Unfortunately, I am not able to combine this with the „{query}“ macro. When I use
search „mykeyword {query}“
this doesn’t work. Any idea why? Of course, I can save the {query} into a tmp-file and read this tmp-file afterwards, but this method would make some other things complicated. How can I pass a selection to „myself“ the best way?
Is there a way to get „back“ to the previous query somehow? Lets say, I am at the level of seeing some sub-elements that I have called somehow (using the method you guys will hopefully suggest me to use to solve the above issue) and I want to get back to see the upper-level elements. The only way seems to be to hit „ESC“, „cmd-space“ „arrow up“, „arrow up“ to use the history function. Is there any better way?
I hope my questions are not too confusing, but I am unfortunately not yet able to give examples, as I am in a very early stage of developing this workflow.
Looking forward to any feedback.
Christian