smarg19 Posted June 26, 2014 Share Posted June 26, 2014 (edited) Spritzran Alfred Speed-Reading workflow Current Version 1.0Available on Packal Spritzr is a relatively simple workflow that allows you to speed-read text on your Mac using Spritz-style techniques. The simple idea is that one word of your input text is displayed at a time in quick enough succession that you are no longer Sub-Vocalizing, which is the largest impediment to reading at a comfortable, yet swift pace. The added layer of nuance, however, is that each word is positioned around the so-called Optimal Reading Position. To borrow an image from the Spritz website, the difference between most electronic speedreaders and Spritz-style speedreaders is the alignment of the words:This workflow achieves a similar affect, thus making reading simpler and faster.NOTICE: I wrote all of this software from scratch and have no affiliation with the Spritz company. I was inspired by other open-source projects that attempt to mirror the Spritz functionality: OpenSpritz and spritz-cmd, but this software bares no relation to Spritz aside from appearances.Spritzr currently only has one command: spritz. This takes text input which will be parsed and displayed in the Spritzr window.Alternatively, you can pass text files (.txt, .md, .mmd) into Spritzr using the File Action File Spritzr. This will parse and display the text content of that file in the Spritzr window.There are two settings, which can be changed using the spritzr:set keyword: Words per Minute Reading Mode If you which to change your wpm, simply invoke spritzr:set and input an integer (the default is 250). If you which to change the reading mode, invoke spritzr:set and input either dark or light (the default is light).Dark Mode:Light Mode:Other than that, you can just start spritzing! Edited June 26, 2014 by smarg19 nikivi 1 Link to comment
spacecadet9 Posted June 27, 2014 Share Posted June 27, 2014 This look really interesting... I'm giving it a try now! Link to comment
raguay.customct Posted June 27, 2014 Share Posted June 27, 2014 I can not get it to work. It produces: [ERROR: alfred.workflow.action.script] Code 1: /Users/raguay/Library/Application Support/Alfred 2/Workflow Data/alfred.bundler-aries/bundler.sh: line 20: [: too many arguments 17:58:07 workflow.py:1265 ERROR [Errno 2] No such file or directory: u'/Users/raguay/Library/Application Support/Alfred 2/Workflow Data/alfred.bundler-aries/assets/utility/viewer/default/viewer.app --args/Contents/document.wflow' Traceback (most recent call last): File "/Users/raguay/Dropbox (Personal)/Richard/rag/Alfred/Sync/Alfred.alfredpreferences/workflows/user.workflow.9B0CF2BF-6F91-49A4-9159-61EB9F48F9D0/workflow/workflow.py", line 1263, in run func(self) File "spritzr.py", line 290, in main Spritzr(args[0], wpm, wf).read() File "spritzr.py", line 77, in read self.prepare_viewer() File "spritzr.py", line 151, in prepare_viewer viewer_info = plistlib.readPlist(viewer_plist) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 75, in readPlist pathOrFile = open(pathOrFile) IOError: [Errno 2] No such file or directory: u'/Users/raguay/Library/Application Support/Alfred 2/Workflow Data/alfred.bundler-aries/assets/utility/viewer/default/viewer.app --args/Contents/document.wflow' Link to comment
smarg19 Posted June 27, 2014 Author Share Posted June 27, 2014 I can not get it to work. It produces: [ERROR: alfred.workflow.action.script] Code 1: /Users/raguay/Library/Application Support/Alfred 2/Workflow Data/alfred.bundler-aries/bundler.sh: line 20: [: too many arguments 17:58:07 workflow.py:1265 ERROR [Errno 2] No such file or directory: u'/Users/raguay/Library/Application Support/Alfred 2/Workflow Data/alfred.bundler-aries/assets/utility/viewer/default/viewer.app --args/Contents/document.wflow' Traceback (most recent call last): File "/Users/raguay/Dropbox (Personal)/Richard/rag/Alfred/Sync/Alfred.alfredpreferences/workflows/user.workflow.9B0CF2BF-6F91-49A4-9159-61EB9F48F9D0/workflow/workflow.py", line 1263, in run func(self) File "spritzr.py", line 290, in main Spritzr(args[0], wpm, wf).read() File "spritzr.py", line 77, in read self.prepare_viewer() File "spritzr.py", line 151, in prepare_viewer viewer_info = plistlib.readPlist(viewer_plist) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 75, in readPlist pathOrFile = open(pathOrFile) IOError: [Errno 2] No such file or directory: u'/Users/raguay/Library/Application Support/Alfred 2/Workflow Data/alfred.bundler-aries/assets/utility/viewer/default/viewer.app --args/Contents/document.wflow' Hmm... I'm using the Alfred Bundler to get this utility, and I'm not sure why it's not downloaded. It should download on the first run (so the first run takes a bit of extra time), but then should work smoothly from then on.Could you open the workflow folder, open the test_space.py in an editor and just paste this code in then run it. Tell me what happens then: from workflow import bundler bundler.utility('viewer') This is what should download the viewer app. Link to comment
raguay.customct Posted June 27, 2014 Share Posted June 27, 2014 It then gives: /Users/raguay/Library/Application Support/Alfred 2/Workflow Data/alfred.bundler-aries/bundler.sh: line 20: [: too many arguments /Users/raguay/Library/Application Support/Alfred 2/Workflow Data/alfred.bundler-aries/bundler.sh: line 20: [: too many arguments 22:22:26 workflow.py:1265 ERROR 'modes' Traceback (most recent call last): File "/Users/raguay/Dropbox (Personal)/Richard/rag/Alfred/Sync/Alfred.alfredpreferences/workflows/user.workflow.9B0CF2BF-6F91-49A4-9159-61EB9F48F9D0/workflow/workflow.py", line 1263, in run func(self) File "test_space.py", line 20, in main print wf.settings['modes'] KeyError: 'modes' Link to comment
smarg19 Posted June 27, 2014 Author Share Posted June 27, 2014 Since the bundler isn't my area of expertise, I'm not entirely sure what the problem is. But I suspect it may be a minor versioning issue. Try going to $USER/Library/Application Support/Alfred 2/Workflow Data/alfred.bundler-aries and deleting that entire folder (that is, the alfred.bundler-aries folder). Once it's deleted try to run that test_space.py code again (also, you can delete everything in that code and just paste in these two lines: from workflow import bundler print bundler.utility('viewer') The other stuff in that code is unnecessary. It will take a bit of time for the bundler to install itself and get going, but hopefully a fresh start will get things working properly. Link to comment
raguay.customct Posted June 27, 2014 Share Posted June 27, 2014 That did it. I have not tried the bundler stuff yet. Nice workflow. I will give it a workout. Link to comment
smarg19 Posted June 27, 2014 Author Share Posted June 27, 2014 That did it. I have not tried the bundler stuff yet. Nice workflow. I will give it a workout.Glad that fixed everything! Link to comment
WyldKard Posted June 27, 2014 Share Posted June 27, 2014 This would be amazing with support for read-later services like Instapaper. Link to comment
smarg19 Posted June 27, 2014 Author Share Posted June 27, 2014 You can use the Spritz bookmarklet to speedread any webpage using this technology. Check out the official Spritz bookmarklet here: http://www.spritzinc.com/where-can-i-experience-spritz/ That would work with Instapaper articles (viewed online) as well as Pocket, or any webpage whatsoever! Link to comment
bclev Posted July 1, 2014 Share Posted July 1, 2014 Hey Smarg, I tried to run the workflow, but I'm getting this error: (I edited out my short name) <?xml version="1.0" encoding="utf-8"?> <items><item valid="no"><title>Error in workflow 'com.hackademic.spritzr'</title><subtitle>[Errno 13] Permission denied: u'/Users/xxxx/Library/Application Support/Alfred 2/Workflow Data/alfred.bundler-aries/assets/utility/viewer/default/viewer.app/Contents/document.wflow'</subtitle><icon>/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns</icon></item></items> I got this error by adding a "copy to clipboard" output to the workflow when it wouldn't work. Any ideas? I tried the method you gave to raguay, and the bundle downloaded fine. It just will not run. Link to comment
smarg19 Posted July 2, 2014 Author Share Posted July 2, 2014 This appears to be an issue with Gatekeeper settings. To be honest, Gatekeeper is a real bugaboo. I've tried to set things up to circumvent this, but it's quite complicated. Did this error only pop up after you added the copy to clipboard? If so, the simple reason is that there is nothing to copy. Could you remove that option and try to run the workflow as is with the debugger on and report that error? Link to comment
bclev Posted July 6, 2014 Share Posted July 6, 2014 This appears to be an issue with Gatekeeper settings. To be honest, Gatekeeper is a real bugaboo. I've tried to set things up to circumvent this, but it's quite complicated. Did this error only pop up after you added the copy to clipboard? If so, the simple reason is that there is nothing to copy. Could you remove that option and try to run the workflow as is with the debugger on and report that error? Starting debug for 'Spritzr' [INFO: alfred.workflow.trigger.action] Processing output 'alfred.workflow.action.script' with arg '( "/Users/xxxx/Downloads/Seven.Speed.Reading.2014.v14.3.Mac/Instructions.txt" )' [ERROR: alfred.workflow.action.script] Code 1: 11:28:09 workflow.py:1265 ERROR 'utf8' codec can't decode byte 0x92 in position 695: invalid start byte Traceback (most recent call last): File "/Users/xxxx/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.B221076E-3705-4AC6-B44F-3BDC6C817DC9/workflow/workflow.py", line 1263, in run func(self) File "spritzr.py", line 286, in main article = wf.decode(file_obj.read()) File "/Users/xxxx/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.B221076E-3705-4AC6-B44F-3BDC6C817DC9/workflow/workflow.py", line 1496, in decode text = unicode(text, encoding) UnicodeDecodeError: 'utf8' codec can't decode byte 0x92 in position 695: invalid start byte [INFO: alfred.workflow.action.script] Processing output 'alfred.workflow.output.clipboard' with arg '<?xml version="1.0" encoding="utf-8"?> <items><item valid="no"><title>Error in workflow 'com.hackademic.spritzr'</title><subtitle>'utf8' codec can't decode byte 0x92 in position 695: invalid start byte</subtitle><icon>/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns</icon></item></items>' Link to comment
smarg19 Posted July 6, 2014 Author Share Posted July 6, 2014 This is a somewhat odd error. It means that this text file is encoded oddly. Can you open up Terminal and use this command to try and see the character encoding for thatInstructions.txt file: file -I {filename} For {filename} put the full path to that file. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now