Jump to content

DrLulz

Member
  • Content Count

    62
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by DrLulz

  1. My initial attempt at an Anki workflow. More to come after boards (have to put away addicting things such as Alfred ). I welcome any and all suggestions. Download, GitHub, Packal. Requirements: Alfred Anki Commands: :anki :aset :apath Anki Terminology: Collection = Group of Decks Notes = Collection of Facts Cards = Representation of Facts A note has a one to many relationship with cards, while a card can have only one associated note. Custom Dark Theme: Cards (notes) created from the workflow use this theme. Once the first card is created (from within workflow) the th
  2. I appreciate the demo. Thank you for that. I'm going with the leveled approach for the "drill-down". The easier the workflow is to navigate the more I use it, so usability and functionality are my top concerns. In the Alfred-Workflow readthedocs tutorial you use argparse, but I've noticed in many of you workflows you use docopt. What's the advantage? Also, in one of my tests I chained a script filter to a run script which saves cached_data before calling a trigger. Its working ok, but is this disadvantageous? It won't be used too often, as I'm shooting for leveled navigation, but
  3. So, as always it seems, I need to dig a little deeper before asking questions. My first question is outlined, in detail, in the Alfred-Workflow docs under Persistent Data. Please disregard question 1. I'm not a programmer, so I'm really looking for a way to think about structuring this project. Though, I'm sure its hard to say given that I don't have more information regarding the desired goal. I'm trying to prevent a complete rework after I'm months into the project, but then again, that may be just what I need to actually learn something.
  4. I have a few questions regarding workflow structure, storage, and python how-to's. Anki is a flashcard program, it is written in python, and has a sqlite database. 1. In order to connect to the database I need to supply a path. Since I'm using the Anki module alone (without anki's version of PyQt, aqt), I have to supply the path manually. The way I'm doing this is rather costly, and I would like to "store" the path after a successful connection is made, so further instances of the workflow have access to and use this path. Below, I've covered the most likely paths to Anki, but at a
  5. Result from terminal. Is this my issue? : drlulz$ env -i runanki env: runanki: No such file or directory
  6. I have an executable located at ~/Documents/anki/runanki echo $PATH = /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin I created an alias in .bash_profile, but I know from searching that Alfred doesn't load the local environment. I would like to call runanki from a run script, but can't figure it out. I don't really care about using the alias in Alfred. Have tried the following, all of which work in the terminal. What is my hangup? /Users/drlulz/Documents/anki/runanki cd ~/Documents/anki runanki shopt -s expand_aliases if [ -f "${HOME}/.bash_profile" ] ; then s
  7. GitHub link is broke, remove the semicolon it should work.
  8. The version I'm using was downloaded last week from Packal. When I type "pocket wf:reset" and press return nothing occurs visibly, its is as if its waiting for an argument. I assume it would prompt me to reauthorize after running the reset?
  9. Sometimes calling the workflow produces no results when it did previously. If I delete com.fniephaus.pocket from Keychain and run the workflow again everything is fine. Is there something I can do to prevent this behavior?
  10. Possibly you should require an IQ test on certain workflows. Maybe a secret sub-forum where people like me can't access. In my haste I forgot to install pandoc. I guess I thought it was a web service, I'm not sure what I was thinking. Apologies.
  11. (dp0Voutputs p1 (lp2 (dp3 Vdescription p4 VPortable Document Format p5 sVarg p6 Vpdf p7 sa(dp8 g4 Vnative Haskell p9 sg6 Vnative p10 sa(dp11 g4 VJSON version of native AST p12 sg6 Vjson p13 sa(dp14 g4 Vplain text p15 sg6 Vplain p16 sa(dp17 g4 Vpandoc\u2019s extended markdown p18 sg6 Vmarkdown p19 sa(dp20 g4 Voriginal unextended markdown p21 sg6 Vmarkdown_strict p22 sa(dp23 g4 VPHP Markdown extra extended markdown p24 sg6 Vmarkdown_phpextra p25 sa(dp26 g4 Vgithub extended markdown p27 sg6 Vmarkdown_github p28 sa(dp29 g4 VreStructuredText p30 sg6 Vrst p31 sa(dp32 g4 VXHTML 1 p33 sg6 Vhtml p34 sa
  12. Pandoctor 1.0.5 Alfred 2.6 (374) Starting debug for 'Pandoctor' [ERROR: alfred.workflow.action.script] 10:51:12 pandoctor.py:1206 DEBUG {u'<argument>': u'/Users/drlulz/Desktop/Untitled.md', u'<flag>': u'in_path', u'config': False, u'help': False, u'launch': False, u'run': False, u'search': False, u'store': True} 10:51:12 workflow.py:940 DEBUG Loading cached data from : /Users/drlulz/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.hackademic.pandoctor/runner.cache 10:51:12 workflow.py:940 DEBUG Loading cached data from : /Users/drlulz/Library/C
  13. Not sure what I'm doing wrong. I ran dr:config Now trying to convey .md to mediawiki. After selecting output format I get Error in workflow 'com.academic.pandoctor' with subtitle u'options'.
  14. I got as far as returning the below from python, but was running into many issues in different circumstances. [(u'insulin', u'http://www.merriam-webster.com/medical/insulin' u'a protein hormone that is synthesized in the pancreas from proinsulin and secreted by the beta cells of the islets of Langerhans, that is essential for the metabolism of carbohydrates, lipids, and proteins, that regulates blood sugar levels by facilitating the uptake of glucose into tissues, by promoting its conversion into glycogen, fatty acids, and triglycerides, and by reducing the release of glucose from the live
  15. Here's what I've changed. I not getting an error but I'm not getting results either. # encoding: utf-8 from workflow import Workflow, ICON_WEB, web from bs4 import BeautifulSoup #from lxml import etree import sys API_KEY = 'API' def _mdict_search(query): url = u'http://www.dictionaryapi.com/api/v1/references/medical/xml/' + query + "?key=" params = dict(auth_token=API_KEY) r = web.get(url, params) r.raise_for_status() return _mdict_results(r.content) def _mdict_results(content): soup = BeautifulSoup(content) words = soup.find_all(id=True) res
  16. I'm finding it difficult to see my errors. For instance, I'm getting 'unicode' object has no attribute 'items' but I'm not sure where to look. Might this have something to do with for word in words: or for result in results:?
  17. Thanks for the switch in perspective. I read part one of your tutorial twice, the second time very slowly. As an exercise I'm trying to recreate the idea with something I'd use often. Merriam-Webster has a Medical Dictionary, and also an API. The results are returned with xml, so I found a thread where you do something similar. In the example you're grabbing html tags, unless I'm missing some fundamental idea (very likely the case) I didn't see why I couldn't do this with the returned xml. Though, now that I'm writing this I don't see why I'm parsing xml to turn it back to xml other than t
  18. What I was going for was to start the workflow using a keyword with flags as options. So, something like "export -t -i -400 : tag1 tag2" would export highlights, titlecase text, export images at a width of 400px, and apply tags. Another option is infer spaces (-s) which is dependent on a wordlist. I was trying to speed up this process of inferring spaces by having wordlists suited to different areas, so the list would be shorter. (Enter snafu) If the user choose to infer spaces on their text I wanted the applescript to call up Alfred, have Alfred present my xml, make a selection, and then pass
  19. I borrowed my wife's LG bluetooth headset (she gave me a weird look). I was clear across the room (~10m) using Alfred Remote triggers with the headset mic for dictation. Neat!
  20. Doing a Skim search with dictation and then advancing page results with Alfred remote. 1. Remote Trigger --> Keyword 2. Dictate Query --> Skim Search Applescript 3. Use Run Script on the Remote to advance page results. (icon) The search Applescript is "listening" (not really, but you get the idea) for keypress with: on isControlKeyPressed() return (do shell script "/usr/bin/python -c 'import Cocoa; print Cocoa.NSEvent.modifierFlags() & Cocoa.NSControlKeyMask > 1'") is "True" end isControlKeyPressed To advance the page use: tell application id "sevs"
  21. I thought I'd put this here, if it's not the right place let me know. The dropbox link below is a somewhat cohesive version of my fork. A few more questions. If I want to include _skimmer.app in the workflow do I have your permission, and if yes what is the correct way to credit you? In your experience how often do new app releases break workflows? Initially I had everything setup correctly in the above posts, but I never thought Evernote itself was the issue, and I still think its odd that file://localhost will not run from OmniOutliner after Yosemite. Dropbox
  22. I've been doing some reading. I didn't want to reply back without a specific question, and I'm not sure if I should start a new thread for this so I'll just post it here until someone tells me otherwise. The wikify workflow was a big help, and I was successful getting crosstalk working between applescript and python. This work around is laughable. Please, someone point me in the right direction. I am attempting to call the Alfred window from Applescript, make a selection, and then return the result. The idea is described in this post. I’ve done the following. tell application "A
×
×
  • Create New...