Jump to content

smarg19

Member
  • Posts

    505
  • Joined

  • Last visited

  • Days Won

    10

Reputation Activity

  1. Like
    smarg19 got a reaction from 40-02 in Pandoctor: An Alfred GUI for Pandoc   
    To everyone who still has interest in this workflow:
     
    I am sorry that it no longer works. I no longer need or use the workflow. I developed it when I was in graduate school and writing all the time. I have since left academia and haven't really needed this (or my other workflows) in years. However, I do still love this little workflow and would love to get it healthy again, but it has been years since I've fiddled with Alfred workflows. If anyone wants to become the new maintainer, I would be happy to spend a weekend afternoon or an evening pairing with someone to get it updated and fixed and then hand over the Github repo. Let me know if you are interested.
  2. Like
    smarg19 got a reaction from ThomasP in Pandoctor: An Alfred GUI for Pandoc   
    To everyone who still has interest in this workflow:
     
    I am sorry that it no longer works. I no longer need or use the workflow. I developed it when I was in graduate school and writing all the time. I have since left academia and haven't really needed this (or my other workflows) in years. However, I do still love this little workflow and would love to get it healthy again, but it has been years since I've fiddled with Alfred workflows. If anyone wants to become the new maintainer, I would be happy to spend a weekend afternoon or an evening pairing with someone to get it updated and fixed and then hand over the Github repo. Let me know if you are interested.
  3. Like
    smarg19 got a reaction from Bernardo_V in Pandoctor: An Alfred GUI for Pandoc   
    To everyone who still has interest in this workflow:
     
    I am sorry that it no longer works. I no longer need or use the workflow. I developed it when I was in graduate school and writing all the time. I have since left academia and haven't really needed this (or my other workflows) in years. However, I do still love this little workflow and would love to get it healthy again, but it has been years since I've fiddled with Alfred workflows. If anyone wants to become the new maintainer, I would be happy to spend a weekend afternoon or an evening pairing with someone to get it updated and fixed and then hand over the Github repo. Let me know if you are interested.
  4. Like
    smarg19 got a reaction from nikivi in Spritzr: an Alfred Speed-Reading workflow   
    Spritzr
    an Alfred Speed-Reading workflow
     
    Current Version 1.0
    Available 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!
  5. Like
    smarg19 got a reaction from HOrdover in Your must-have workflows?   
    I'm taking that as a compliment
  6. Like
    smarg19 got a reaction from deanishe in ZotQuery: an Alfred workflow for Zotero   
    You're a better fella for writing 99% of it!
  7. Like
    smarg19 got a reaction from alibolcakan in KA Torrents   
    Yes. I have just fixed it. Will hopefully be able to push the new version this weekend.
  8. Like
    smarg19 reacted to deanishe in Your must-have workflows?   
    A new workflow that has quickly become a firm favourite: Search OmniFocus.
     
    Because it directly accesses OmniFocus's sqlite database files instead of using AppleScript to talk to the application, it's insanely fast. This makes is so much more useful than other OF workflows.
     
    Insanely fast.
  9. Like
    smarg19 got a reaction from xilopaint in Your must-have workflows?   
    Great idea. Here are 4 that I use almost every day:
    MarkdownBulletin: you've said it already @deanishe, but it's worth repeating. I post on the forums frequently enough, and this workflow (by Vítor) makes that bearable, sometimes even enjoyable. PirateBay: say what you want about the PirateBay, but if you use it, you need this workflow. Period. Great workflow from Florian. Packal Updater: Packal is swiftly becoming the default way to share Alfred workflows. This is great for this burgeoning community and Shawn did a great job on it. But the functionality was only halfway there until he also put out this workflow to keep up with all of your Packal-downloaded workflows. This is a must have. Evernote: I love Evernote. I love Alfred. I love CarlosSz. Simple as that. PS. I link to all the authors' Packal pages because there is a mechanism to leave a PayPal donation for the author. I use the hell out of the some of the workflows on this forum and (now) on Packal. These are not simple to make or to maintain, and I for one try to give just a little thank you.
  10. Like
    smarg19 reacted to deanishe in How to run script from /usr/local/bin?   
    /usr/local/bin is not a language (neither is /bin or /usr/bin). They're directories.
     
    Your environment has a variable called PATH, which is a list of directories. When a program (or a shell) wants to run another program, it can simply call it by name (e.g. VBoxManage) provided it is in one of the directories in PATH.
     
    Alfred's PATH is the default one of /bin and /usr/bin, so any program in either of those directories can be called by name.
     
    If you want to run a program in /usr/local/bin, you have to call it by its full path, e.g. /usr/local/bin/VBoxManage.
     
    So, instead of running VBoxManage startvm "vm_name" you just need to run:
    /usr/local/bin/VBoxManage startvm "vm_name"
  11. Like
    smarg19 reacted to deanishe in [Request] HTML and CSS Tidy Workflow   
    The indentation of the HTML is an option to tidy.
     
    The following script will do what you want (for HTML). Stick it in a Run Script action with language = /bin/bash. Connect it to a Keyword or Hotkey to run it. 
    export LANG=en_US.UTF-8  # needed to make pbpaste and pbcopy work properly pbpaste | /usr/local/bin/tidy -i -utf8 | pbcopy It should be simple enough to adapt for tidyCSS, but I don't have that.
  12. Like
    smarg19 reacted to frankspin in Slackfred: Interact with your Slack channels, groups and IMs   
    Good catch! I just updated the workflow file to include the library. Can you give it another go? https://github.com/fspinillo/slackfred/blob/master/workflow/Slackfred.alfredworkflow
  13. Like
    smarg19 got a reaction from poweryn in KA Torrents   
    Not in any sensible way that I can of. I personally don't really see any of that, but I'm mostly searching for TV episodes and movies. Is there some way to tell easily? I could filter results, but I would need to know what to filter on.
  14. Like
    smarg19 reacted to deanishe in pandoctor not putting (but no error messages)   
    workflow:opencache ftw
  15. Like
    smarg19 reacted to Vero in Pandoctor configuration   
    I would recommend popping a post in the thread for the workflow, so that the creator of the workflow can help you get it working. It's best to give context of which workflow you're trying to use so that fellow Alfred users can help you out.
     
    I assume you're referring to this workflow:
    http://www.alfredforum.com/topic/4686-pandoctor-an-alfred-gui-for-pandoc/
     
    Cheers,
    Vero
  16. Like
    smarg19 reacted to deanishe in Workflow Library for Python   
    Just released a new version of Alfred-Workflow with a very important change.
    Thanks to Owen Min, Alfred-Workflow will now prevent Alfred from killing your Script Filter in the middle of writing to a file. Previously, the workflow could be left in an invalid state (e.g. empty, invalid settings file).
    web.py is now easier to use: It will properly combine any GET parameters specified in the function call with any already in the URL.
    Also added a rudimentary Dash docset to the repo.
  17. Like
    smarg19 reacted to Andrew in Allow manual editing of UTIs in File Types fields   
    I'm going to look at adding this soon... I've had a long created ticket for this and never got around to it
  18. Like
    smarg19 reacted to Andrew in Make URL-encoding smarter or optional   
    I agree, there are definitely improvements which can be made in this area, but I may leave this until a more major release (as there is the Workflows workaround at this point).
     
    Other improvements would be the option to encode spaces as other characters such as - and _ which would give even more flexibility.
     
    I've added a ticket
  19. Like
    smarg19 reacted to deanishe in Workflow Library for Python   
    With regard to the GET parameters, workflow.web isn't very smart. The best thing to do is pass the GET parameters as a dictionary in the params arg, using a bare URL: web.get('https://slack.com/api/search.messages' params=dict(token=api_key, query=query, ...)) .

    requests is much smarter in this regard: you can pass GET parameters in the URL and/or via params. In either case, I'd recommend passing query via params as then both requests and workflow.web will ensure it's properly URL-encoded.

    Bummer you need to make two requests per API call

    Regarding threading: that can be a very tricky topic. In this case, you might be able to whip up something fairly simple using the Pool class from multiprocessing.dummy and its apply_async() or map_async() methods:
     
    from multiprocessing.dummy import Pool pool = Pool(5) # allow 5 simultaneous connections results = {} for url, params in urls: future = pool.apply_async(web.get, (url, params)) results[url] = future pool.close() # accept no more jobs pool.wait() # wait for queued jobs to finish and threads to exit # Populate `results` from the return value of the futures for url in results: future = results[url] results[url] = future.get() # Do what you want with results here... With regard to OOP, it doesn't make any difference. I didn't explain the issue very well. It's not so much that the function/class/whatever combines speaking with Alfred and speaking with an API, it's that the responsibilities aren't clearly separated and the code isn't properly layered.

    If there's an error, your functions bypass main() and talk directly to Alfred, which is otherwise the job of main(). That's a recipe for confusion. To be clear, it's not a huge deal for your functions to add an error message to the output with wf.add_item(), but they shouldn't be calling wf.send_feedback(). Effectively, that terminates the workflow and the lifetime of the workflow is main()'s responsibility.

    To give an analogy: you're the head of procurement (main()) and it's your job to collate all the internal orders and place the monthly order with your supplier (Alfred). You have several members of staff each responsible for different departments' orders. Normally, when they've collated their individual departments' orders, they bring them to you and you consolidate them into a single monthly order to the supplier.

    One of your team members (search_slack()) has an annoying habit of drafting his departmental order, but instead of giving it to you, he sometimes contacts the supplier himself and places the monthly order, but only for his stuff. And he doesn't even tell you when he's done this, so everyone else carries on preparing their orders without knowing it's too late to place them and they're wasting their time.

    Although that might be the right thing to do sometimes, he isn't in a position to know whether that's the case, and he's clearly overstepping his authority.

    In the script, if one of the API keys is invalid, search_slack() reports this, but also silently closes the reporting channel, so all the work done with other, valid API keys is silently thrown in the bin. Equally, any other keys that are invalid will also have their error reports thrown in the bin.
  20. Like
    smarg19 reacted to Cassady in Skimmer: PDF actions for Skim   
    Wow.
     
    How I wish I had found your workflow 5 years ago, BEFORE I tried to OCR double page scans!
     
    Thank you. It will prove invaluable going forward, and will save many hours of time!
  21. Like
    smarg19 reacted to u-4 in Wikify (Evernote Wiki-Helper)   
    I got same error as Br4ndon got. I'm not familiar with scripts (and English), but I tried to solve this problem.
     
    In Evernote6, "HTML content" no longer contain "<body></body>" (I confirmed this by inserting "return this_html" just above the line containing this problem.). So I replaced "find text "<body.*?>(.*?)</body>" in this_html" with "find text "\".*?(.*?)\"" in this_html", and this change seems working well. 
     
    I hope this helps.
     
     
     
     
  22. Like
    smarg19 got a reaction from gabamnml in Packal: Workflow and Theme Repository   
    Perhaps an odd question, but will it be possible to view download stats for your own workflows?
  23. Like
    smarg19 reacted to Sebastian Daza in ZotQuery: an Alfred workflow for Zotero   
    That was! Solved, thanks!
  24. Like
    smarg19 got a reaction from deanishe in First Workflow: Need Ideas, Suggestions, Examples, Documentation   
    Ok. There's obviously a lot going on here, but I think it's all right headed. First, I would recommend you stay with your inclination and start dipping into Python. Once I moved from AppleScript to Python, I've never looked back. If I ever need Applescript specific functionality, I can invoke directly within a Python script. So, big vote for Python.
    On that same line, I think building things for and with Alfred is a great way to start, so I would also recommend that intuition. It has a number of limitations, which keep things fairly well within scope, but it's also incredibly flexible, so you can do crazy things (my own workflows are all over the map in terms of functionality and how they use Alfred's interface). I really think you should start by reading the documentation for the Alfred-Workflow Python library. It's a great introduction to writing workflows for Alfred in Python. And that library is (IMHO) the best for integrating a scripting language with Alfred. Then, I'd also read through the source code on GitHub to start getting a feel for how Python is written, especially for Alfred. Dean, who wrote the library, is a very gifted Pythonista and his code is an excellent example of Python code; very clear, very direct, very clean.
    Next, start topics in this forum for specific questions. The people here are here frequently enough and like to help. And having a specific question with a specific goal will likely get some good responses. I've learned so much from the people on this forum.
    Finally, on general advice, I'd remind you to keep refactoring. You will learn new things all the time; go back and put them into practice in a code base you know well.

    So, that's general advice, here's some specific thoughts on your questions.
    First, I answered the Evernote images question in your other thread response. The key are HTML image links with URLs to local files.
    The infer_spaces() algorithm is a bit much to take in on first read, but it looks pretty efficient as it. As for passing arguments to a Python script from Applescript and getting the results back, check out my Wikify workflow, and specifically the en2md.scpt, which calls to a Python script. Passing over numbers should be fairly simple, just add an if clause to the function, like if isinstance(character, int): continue (this is Python). This would likely go best here in the Python code linked above:

    # Backtrack to recover the minimal-cost string. out = [] i = len(s) while i>0: if isinstance(s[i], int): continue c,k = best_match(i) assert c == cost[i] out.append(s[i-k:i]) i -= k Finally, for word frequency of texts, you should really check out the NLTK Python package. For some idea of how to get word frequency from a text using that Python package, see section "3.1 Frequency Distributions" here.Those are my initial responses. Please do respond with any further questions...
    stephen
  25. Like
    smarg19 reacted to rice.shawn in First Workflow: Need Ideas, Suggestions, Examples, Documentation   
    I'm not sure what you're getting at here either. Why do you need to modify proxy.scpt? Two things on this:
     
    (1) Keep your code and your data separate. If you are modifying a script to be run, then you should consider it data. Keep the original (template) in the workflow directory, and then all modified copies should be in either the data or the cache directory.
     
    (2) If you're using Python in other places, then you should try to stick with it as much as possible. But if you want to use a "Choose From List" AppleScript function, then you could also try to call that from Python. Basically, the "Choose from List" AppleScript is just a string that you can invoke via the shell via osascript, so you use can Python to construct the string and call as Python would call any shell script.
     
    (3) AppleScript prompts can be cool, but I always try to keep my use of them to a minimum. If your "Choose From List" comes up with just a couple (say fewer than 9) options, and you want to select only "one" option, then you could always keep everything in a script filter and have the user choose from a list of results there.
×
×
  • Create New...