Jump to content

Getting a workflow to execute multiple actions


Recommended Posts

I'm trying out creating my first workflow.  I thought it would be a simple one, but I'm having what I am sure is a newbie challenge.

 

I wanted to create a workflow that opens all of the apps/urls I need when I am starting working on a particular project.

 

I started with the template to Open custom URL in specified browser.  After setting the first one up I clicked on the + and added the additional actions (2 more custom URL actions and 1 launch multiple files).  They all add on the screen, but the line linking them to my keyword isn't there.  Just for the original item.

 

Any thoughts on what I am doing wrong?

Link to comment

What you need to do is to click on the edge of the keyword and drag the cursor to the action. That will create the line.

 

But, why not just simplify things and have the keyword call a bash script?

 

If you want to open a list of custom urls, then just have the script read

open http://www.google.com
open http://images.google.com
open http://www.alfredforum.com

If you want to open an application, then your line will read

open /Applications/Utilities/Terminal.app
open /path/to/application.app

And if you want to open a file, then

open /path/to/escaped\ filename.txt

Just remember to escape any filenames. The most common character to escape is a space, so, as shown above, just put a backslash in front of it. If you want to test the command, then open a terminal and type the command.

 

If you want to have a list of URLs, files, and applications per project, then you might want to make it a bit more complex in that you'd create a file for each project that has all of the paths in it and then run through them in a foreach loop. You could also make it nicer so that you'd have a "projects" folder containing these files, and then you'd create a script filter that would read all of the files in the folder and return them as results in Alfred to launch, but that might be getting ahead of things.

 

Shawn

Link to comment

I'm trying out creating my first workflow.  I thought it would be a simple one, but I'm having what I am sure is a newbie challenge.

 

I wanted to create a workflow that opens all of the apps/urls I need when I am starting working on a particular project.

 

I started with the template to Open custom URL in specified browser.  After setting the first one up I clicked on the + and added the additional actions (2 more custom URL actions and 1 launch multiple files).  They all add on the screen, but the line linking them to my keyword isn't there.  Just for the original item.

 

Any thoughts on what I am doing wrong?

 

Shawn is correct that the way he mentioned doing is a great way to implement it. I will note though, just to make sure you question is answered. If I understand correctly what it is that you are wanting to do, you can put multiple actions attached to a single keyword. The same way you connect a keyword to an action (dragging the little tab to the next block) can be used to attach the keyword to numerous items. You just can't attach another action to the back of an action and expect them to be sequential. If you attach multiple actions to a single keyword, they will all be fired simultaneously.

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...