Editorial Workflows

Get Contact

public workflow

Install Workflow...

This workflow contains at least one Python script. Only use it if you trust the person who shared this with you, and if you know exactly what it does.

I understand, install the workflow!

This is a workflow for Editorial, a Markdown and plain text editor for iOS. To download it, you need to view this page on a device that has the app installed.

Description: I modified @jollipixel’s “get contacts” workflow to copy outputted name & contact info to clipboard, to paste where needed.

Original description by jollipixel:

Get Contact by @jollipixel

It's meant to be used as a Subworkflow.

Prompts for a name (could be partial name) and returns '<full name><tab><email address or phone number>' from your Contacts as a string.
Will present a list if multiple matches are found.

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Set Variable ?
Variable Name
Name
Value
(Will be set later)
Set Variable ?
Variable Name
isList
Value
(Will be set later)
Find Contact Name ?
Source Code
#coding: utf-8
import workflow
import contacts
import console

people =''
names = ''

while not people:
	name = console.input_alert('Name','Enter Name to search for')
	people = contacts.find(name)
	if not people:
		console.hud_alert('No ' + name + ' in Contacts', 'error', 1)

for p in people:
	names += p.full_name + '\n'

names_lst = list(set(names.splitlines()))
if len(names_lst)>1:
	workflow.set_variable('isList', '1')
else:
	workflow.set_variable('Name', names_lst[0])

workflow.set_output(names)
If List... ?
Run the block if
isList
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
1
Select Name ?
Title
List (Lines)
Input
Multiple Selection
OFF
Show in Popover
OFF
Set Name ?
Variable Name
Name
Value
Input
...End If List
Find Contact Details ?
Source Code
#coding: utf-8
import workflow
import contacts
import console

name = workflow.get_variable('Name')
details = ''

people = contacts.find(name)

if people[0].phone:
	for phone in people[0].phone:
		details += phone[0].strip('_$!<>') + ' ' + phone[1] + '\t' + phone[1] + '\n'

if people[0].email:
	for email in people[0].email:
		details += email[0].strip('_$!<>') + ' ' + email[1] + '\t' + email[1] + '\n'

if details:
	details_lst = details.splitlines()
	if len(details_lst) > 1:
		workflow.set_variable('isList', '1')
		workflow.set_output(details)
	else:
		workflow.set_variable('isList', '0')	
		details = details_lst[0].split('\t')
		workflow.set_output(details[1])
else: 
	console.hud_alert('No details for ' + name, 'error', 1)		
	workflow.stop()
If List... ?
Run the block if
isList
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
1
Select Contact Details ?
Title
List (Lines)
Input
Multiple Selection
OFF
Show in Popover
OFF
...End If List
Generate Text ?
Text
Name Input
Set Clipboard ?