Skip to content

Instantly share code, notes, and snippets.

@codiez
Created December 22, 2009 13:22
Show Gist options
  • Save codiez/261740 to your computer and use it in GitHub Desktop.
Save codiez/261740 to your computer and use it in GitHub Desktop.
Auto sends highlighted text to your iphone from any application, use in a service workflow
'''
To be used as part of an automator script, install as a service.
Sends the highlighted text to your iphone using prowl
'''
import sys
from prowl import Prowl
import Growl
notifier = Growl.GrowlNotifier('Prowl', ['status'])
notifier.register()
p = Prowl()
image = Growl.Image.imageFromPath('/path/to/image')
note = ''
for f in sys.stdin:
note = note + f
note = note[:1000]
try:
p.post('Mac','Note', note)
notifier.notify('status','Prowl sent', note, image)
except:
note = 'Error sending: ' + note
notifier.notify('status','Prowl error', note, image)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment