palobo Posted February 2, 2013 Share Posted February 2, 2013 Hey Guys, Kinda slow this weekend and I'm stumped on this one. How can I setup a file action in such a way that it accepts additional input in Alfred. Use case: My Spotlights Comment Workflow uses keyword trigger, accepts some text and then applies the text to the spotlight comment of the selected file. Now how could I setup a file action so that I could select one or more files in Alfred > action then choosing file action > get Alfred window again > input text which is then applied to file(s) in buffer or selected by Alfred. I know I can summon Alfred via AppleScript with the search "keyword trigger here" but that then looses focus of the selected files. Is this possible yet, planned or not even in the pipeline? If not I'll have to tag the long route, storing files that were selected then summoning Alfred etc. Link to comment
CarlosNZ Posted February 2, 2013 Share Posted February 2, 2013 It's not ideal, but you could make your File Action script prompt the user with an AppleScript-based dialog prompting the user for additional text. Link to comment
palobo Posted February 2, 2013 Author Share Posted February 2, 2013 It's not ideal, but you could make your File Action script prompt the user with an AppleScript-based dialog prompting the user for additional text. Yeah, that I know, but like you said it's far from ideal. Link to comment
phyllisstein Posted February 4, 2013 Share Posted February 4, 2013 Also less than ideal, but could you pass the file's path in with the keyword when calling Alfred with AppleScript? So you'd get the path from the file action, then summon Alfred with "comment {path}" or something? Link to comment
palobo Posted February 4, 2013 Author Share Posted February 4, 2013 Also less than ideal, but could you pass the file's path in with the keyword when calling Alfred with AppleScript? So you'd get the path from the file action, then summon Alfred with "comment {path}" or something? Yeah, I'm happy with my Mail Actions Workflow for now so I'll dedicate a little time to the others now. Will figure something out I'm sure. Thanks for the ideas though Link to comment
jdfwarrior Posted February 5, 2013 Share Posted February 5, 2013 I was going to suggest the same thing phyllsstein did. Its not the ideal way to get things done but I think thats about the only way you can get multistep type setups with Alfred 2 right now Link to comment
palobo Posted February 5, 2013 Author Share Posted February 5, 2013 Yeah, I've been thinking about something along those lines, or storing the path in some plist or temp file which is then referred to in the next action. Link to comment
jdfwarrior Posted February 5, 2013 Share Posted February 5, 2013 Also thought of suggesting that. Just don't forget to, when its done with the second step, either clear that value, or have a timestamp or something associated with it so that someone doesn't get sidetracked and accidentally run the second step later on and as a result end up performing an action they didn't want/mean to. Link to comment
palobo Posted February 5, 2013 Author Share Posted February 5, 2013 Also thought of suggesting that. Just don't forget to, when its done with the second step, either clear that value, or have a timestamp or something associated with it so that someone doesn't get sidetracked and accidentally run the second step later on and as a result end up performing an action they didn't want/mean to. Yeah, definitely. Part of the action will be to clear out the temp file /plist file. Plain crazy not to Link to comment
jdfwarrior Posted February 5, 2013 Share Posted February 5, 2013 I figured you would. I know you know what you're doing. My reply was really for documentation purposes in case someone else came looking for info Link to comment
palobo Posted February 5, 2013 Author Share Posted February 5, 2013 I figured you would. I know you know what you're doing. My reply was really for documentation purposes in case someone else came looking for info Ah, right. Roger that then. When I think of some simple way of doing it I'll update this so others can use the info too. ;-) Link to comment
xilopaint Posted July 9, 2016 Share Posted July 9, 2016 Sorry for bumping the topic. Is there any feature in Alfred 3 to address this? Link to comment
Vero Posted July 12, 2016 Share Posted July 12, 2016 Sorry for bumping the topic. Is there any feature in Alfred 3 to address this? If you're looking for a way to add multiple inputs (e.g. type an input to filter to a file, then bring up another input to specify what to append to a file), take a look at Alfred 3's Examples > "Dynamic File Search" or "Simple To Do List". Both include multiple inputs to achieve the final goal, and will be a great way for you to get started Cheers, Vero Link to comment
xilopaint Posted July 13, 2016 Share Posted July 13, 2016 (edited) If you're looking for a way to add multiple inputs (e.g. type an input to filter to a file, then bring up another input to specify what to append to a file), take a look at Alfred 3's Examples > "Dynamic File Search" or "Simple To Do List". Both include multiple inputs to achieve the final goal, and will be a great way for you to get started Cheers, Vero Thank you Vero! I am editing the post after David Ferguson kindly send me a simple workflow with comments explaining the usage of Args and Vars utility. Edited July 14, 2016 by xilopaint 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