Jump to content

dfay

Member
  • Content Count

    912
  • Joined

  • Last visited

  • Days Won

    50

Everything posted by dfay

  1. This is really an AppleScript question bc as far as I know there’s no other way to do it with Mail.app . This thread http://macscripter.net/viewtopic.php?id=43790 provides a script that would do more or less what you want. It relies on AppleScript UI scripting (i.e. simulating keystrokes and the like) which tends to make it breakable anytime there’s an OS update.
  2. Actually the API seems to be focused on managing users not content. If you can provide an example of the URL for a Libib search someone could probably help you convert that to a custom search. But based on that API I don’t think displaying search results in Alfred is possible at this point.
  3. In re: the output format, I wouldn't trouble yourself to writing RTF output code unless you've really got it in the bag already. The only formatting that's going to be needed are italics, bold, maybe underlining in a few edge cases. This can be done in HTML and piped to textutil without risk, I'd think. Also I'd agree that collections aren't necessary for the workflow. In my experience, when I would be working with a collection (organizing readings, finalizing references for a paper, etc.), I'd also have my bibliographic software open and be working in there directly. The tim
  4. Yes, seems to be working for me again, too -- thanks again Rob
  5. I haven’t dug into the code to see what’s coming out of the queries, but I think the easiest would be to map it into csl-json https://github.com/citation-style-language/schema/blob/master/csl-data.json based on the zotero field mappings here: https://aurimasv.github.io/z2csl/typeMap.xml The library should handle csl-json & spit out plain text or html - user can choose to use a markdown csl format like this https://github.com/philipbelesky/Markdown-Citation-Style-Languages but the elegance of this approach is that that will be up to the user.
  6. Yeah he had written his own export template scheme for Skim even though there’s a native one that can be implemented in a few lines of AppleScript... Basically you should just need to pipe into the CSL library and let it do its thing. Once you get it to that point post a draft & I can look at it.
  7. If you're going to start over, refactor, clean up, etc., I'd suggest the following: Search for entries (by title, author, tag, all fields) Open entries in Zotero open the attachment(s) for an entry select a CSL file for export format - see http://citationstyles.org output a single citation in the selected format's in-text style ( see http://docs.citationstyles.org/en/stable/primer.html ) output a single citation in the selected format's note style (ditto) same for selected entries in Zotero and/or contents of a group in Zotero The advantage to usin
  8. I find it much more useful to have domain/keyword specific collections as in this use scenario - there’s a lot of stuff I don’t want mixed together in snippets but still want quick access to.
  9. You are welcome to write a Java library -- Alfred can use any language on the system. All the libraries for building workflows are user-created -- I imagine if there were demand for Java, someone would have written one.
  10. Use a list filter https://www.alfredapp.com/help/workflows/inputs/list-filter/
  11. I just figured out that these themes (or the green one at least) don’t allow the user to move the alfred window - where is the setting that toggles this? or could you provide versions that allow it?
  12. seriously, doesn’t karabiner eat up more time in the customizing than it saves? thoroughly puzzled by all this...
  13. Should be fixed now - casualty of dropbox share policy changes
  14. Glad to see you've made the connection. For all people complain about his unmaintained workflows, Stephen did a lot of great work on automation.
  15. Why wouldn’t you just use a file filter set to that directory?
  16. Wow that's eight different variations on the same solution! Thanks guys....I'm sure the time we have committed to this far outweighs the savings for file vs. array vs. json, python vs. bash, etc.
  17. I'd bet that Alfred dumping to a file is faster than starting python and loading two modules....
  18. haha yes I figured you would spot a way to improve my python - thanks!
  19. Well here's what I came up with: File Action (unchanged) write the file list to a text file (files.txt) List of Actions (unchanged) then Run Script: #!/usr/bin/python import sys import subprocess theFiles = open('files.txt', 'r').readlines() for aFile in theFiles: args = ['/opt/local/bin/tag', '-a', sys.argv[1], aFile.replace('\n','')] p = subprocess.call(args) In theory, writing to a file might slow things down a tiny bit, but this is a solution that I will be able to come back to in a year and immediately understand again.
  20. "if you put the File Filter output into a variable, you end up with a single, TAB-separated string, just like if you try to set a workflow variable to an array" -- did not know that...which shows how few workflows I've actually worked up since Alfred 3 came out.... I agree, the code is not pretty, but it is working for me at the moment with spaces in my tags & filenames. Maybe we need a feature request for Alfred to produce a JSON array rather than a tab-delimited list.
  21. spoke too soon...running into the usual pitfalls with escaping spaces in tags and filenames....
×
×
  • Create New...