Jump to content

Simple Ideas: sulky workflows—bug catching


Recommended Posts

Background
This Simple Ideas post (the penultimate one of the series for the time being) is different. There's no skeletal workflow, no painful dissection of any living thing—merely a few little tips for anyone who ever writes a basic workflow that simply sulks and does nothing (assuming that is not what it was designed to do).

I am quite sure these are not mistakes that you commonly make but I am at least, let's say, familiar with them.

A check-list for sulky workflows
1. Check for typos.
2. Check for typos.
3. Check for typos. It is horribly easy to refer a variable with the tinest of typos in it (or even to create one like that and miss the typo when using the variable) and then spend hours wondering at the sullen silence of the workflow when it is run.
4. Package your variables. Remember Alfred has no idea whether theChosenOne is a variable you previously created or an obscure piece of text unless you tell Alfred: so, {var:theChosenOne} please when you use the variable!
5. Have you duplicated a Hotkey Trigger or a Keyword Input? If either is already used by another existing workflow you're not going to get the results you expect from your new workflow.
6. Have you carefully created a variable but then omitted to pass that variable to something in the workflow that expects to receive it? Remember, you can't create and pass on a new variable in the same Arg and Vars utility. You will need another Arg and Vars utility to pass on the newly created variable to whatever it is that expects to receive it.
7. Have you, alternatively, passed to something in the workflow a variable that object should not receive? (The classic example of that is using a second Keyword Input to gather user input but passing to it the input from the first Keyword Input. In that case the second Keyword Input arrives carefully pre-filled with the input from the first Keyword Input…which is probably not what you want.) It is by no means uncommon to have to use an Arg and Vars utility with everything in it completely blank—to ensure that nothing is passed to the next object in the workflow.
8. Have you provided an alternative path in your workflow but forgotten to specify the Action Modifier?
9. Have you simply overlooked completing a variable in an action that expects it? (A number of Automation Tasks allow you to specify, within the task, the variable the task is to process. In a similar way you can specify a variable within the Large Type Output and Copy to Clipboard action.)
10. Are you seeing odd results when pressing esc (perhaps expecting to end the workflow)? Check whether you've told Alfred not to close his window in a place where you should not have done.

Call the emergency services
Stop: don't do it! The emergency services in this case consist of bug-catchers provided by Alfred: the debugger and the Debugger Utility. Both are invaluable when attempting to beat a sulky workflow into submission.

If you open the debugger (⌘D is the easy way) for the relevant worklow then run the workflow Alfred will show you, in the debug window, exactly what the workflow is doing when it runs. Examination of the results can often assist in identifying where things may have gone astray.

Further, you can attach the Debugger Utility to any object in your workflow to check what is being passed out of that object and the value of all variables that exist at that stage of the workflow.

In conclusion
No workflows were harmed in the creation of this post.

Stephen

The Simple Ideas posts

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