Created
December 22, 2009 13:22
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
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