Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

superscape

macrumors 6502a
Original poster
Feb 12, 2008
937
223
East Riding of Yorkshire, UK
Hi,

I wonder if anyone can help? I'm having a problem where a workflow that works fine when run in Automator works differently when saved as a service. It's quite a complex workflow, but I've made a simpler one which replicates the issue (see attached).

In short, the attached workflow looks at the open contact in Contacts.app and makes a new TextEdit document. It then looks up and appends the person's name to the TextEdit document. Next it looks up and appends the person's job title to the TextEdit document. (I know I could look them up all in one go, but I need to do it like this for the more complex workflow).

When I run them in Automator then I get what I expect:

John Doe
Managing Director


However, when I save it as a Service for Contacts and run it from Contacts' Services menu then I get:

John Doe
1234-12324-1234
johndoe@acme.com
John Doe
1234-12324-1234
johndoe@acme.com


I'm confused. Am I doing something dumb here? Any suggestions/thoughts would be welcome.

Thanks in a dvance
 

Attachments

  • demo.zip
    77.6 KB · Views: 232
Last edited:
In a regular Automator workflow, you usually need to include actions to get the items to work with. However, when using a workflow that connects with the system in some way (service, folder action, droplet, etc), the system will pass the appropriate items to the workflow.

If your service workflow is set up the same as the regular one, the solution is to remove or rearrange the actions that get additional items so that you don't get doubled items.
 
Ah... I *think* I see! Thanks for the info.

So it's naive of me to think I can just copy the contents of a 'normal' workflow into a service workflow and expect it to work?

Thanks
 
Well, like I mentioned, if a workflow already has actions to get stuff to work with, then you will wind up with extra/doubled items if you just drop it into a service. If you aren't interested in the items passed to the service workflow (you just want it in the services menu, for example), you can set the first action to ignore its input, but normally a service works with the items it was selected with.
 
Don't know how complex your workflow is but it seems kind of tedious to look at the open contact in Contacts.app to get the info you want. I would dump all the info into a text file.
 

Attachments

  • ContactsInfo.zip
    2.9 KB · Views: 188
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.