Jump to content

Accept additional input on file action


Recommended Posts

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

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

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

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

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
  • 3 years later...

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
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 by xilopaint
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...