Jump to content

iandol

Member
  • Posts

    166
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by iandol

  1. Hi, there was a bug in Bookends V14.0 with the Applescript interface, a silent update fixed it. The bundle id was not being used so that wasn't the problem. I've also updated bookends-tools to V1.3.9: https://github.com/iandol/bookends-tools/releases/tag/V1.3.9 Between the last public release and the latest: https://github.com/iandol/bookends-tools/compare/V1.3.4...V1.3.9 Allow ⇧⌃to copy the bookends:// link as text. allow ⌘⌥ to open an attached PDF directly. betobibtex: Allow using a customised BibTeX formatter, default is the builtin BibTeX, but for example you can make a modified format removing address and abstract that makes export faster and the resultant files much smaller. bebib: make sure this tool uses the citeUsesRTF Alfred environment variable so you can choose RTF or plain text output. There is also a new tool, beconvert, which is only useful if you want to convert author-date formatted citations in e.g. Word, like (Barlow et al., 1963), to temporary user key citations. This really depends on your BibTeX keys also conforming to [authordate], it will not work for any other cases. See https://www.sonnysoftware.com/phpBB3/viewtopic.php?f=6&t=5548 for the details...
  2. OK, one simple workaround for the moment is to set the tempCitationStyle variable in the workflow to your preferred format (in my case Pandoc), then you don't need to use any modifiers: At the moment when you press ⌘ or ⌥ modifiers it routes to a shell script and without a modifier it uses a ruby script and the tempCitationStyle variable — again both routes are working here (I retested, using the latest Bookends and Alfred versions) and I can't see an obvious bug (not that that means one doesn't exist 🤪). The Bibkey itself is returned here in the script: https://github.com/iandol/bookends-tools/blob/master/source/formatCitation.sh#L15 which must be the part failing on your system. I could update the Applescript fragment to use the newer AS library but that is slower than the older events system in my experience. The script also specifies bash and now the default is zsh but bash is still shipped AFAIK... Does setting tempCitationStyle help? What version of Bookends and Alfred? If you run the Applescript directly (in script editor) do you get a correct bibkey back (you need to replace 54808 with a unique ID from your own library😞 tell application "Bookends" return «event ToySRFLD» "54808" given string:"user1" end tell
  3. With the release of V4.5, Alfred substantially improved the action system with https://alfredapp.com/universal-actions — this provides much more control and flexibility for [object][modifier] type work flows! 😍🤩😍
  4. Not to detract from your main question, but there is a non-official dropbox client that uses the official public API and therefore doesn't suffer any device limits: https://maestral.app
  5. And thanks for prompting me to try to switch from ⌘space, I'm still struggling with years of muscle memory, but theoretically I do like the idea of [caps lock] as the Alfred trigger 🤪
  6. At least with BetterTouchTool you can assign different functions when the hyper key is held down or released. So for example: Assign Caps lock to hyper key, and on release map it to a named trigger which sends F18 (BTT doesn't support F19): Then setup F18 in Alfred to trigger. Now you can use hyperkey shortcuts or just trigger Alfred on release... But as the hyper key includes the shift key in my setup I don't think I can add in the shift+hyper universal action trigger, though I can easily assign something like hyper+a so it isn't such an issue.
  7. @vitor -- I did do a search (object verb / quicksilver ui etc.) but didn't turn up a deep dive on the underlying design philosophy of the Alfred UI vs Quicksilver etc. I will see what I can come up with and read through or contribute there. @deanishe -- yes, it is possible Alfred deliberately chose to use a simpler interface and a more flexible modifier setup. I personally don't know how much of the Alfred UI is due to deliberative vs. "organically grown" -- i.e. that @Andrew had a clear idea of what he thinks is best vs. what he may wish to change as Alfred grows. My question was a probe into this type of decision space. Personally I enjoy to discuss possibilities of where a software design can be taken, there is no right or wrong, and Alfred is a wonderful tool whatever... @Chris Messina -- yes, you are right that Alfred's action menu enables something like the [object][modifier] or [object][verb] part of the tripartite Quicksilver design pattern. Workflows in particular can also build multiple-stage patterns that could mirror QS pattern. I personally loved, and still miss, the strong opinionated design pattern that QS represented. Raycast, as a new, though thorougly overhyped piece of shiny, deliberately appears to follows a similar pattern.
  8. Sorry I haven't been on this forum for a while, do you still have this problem? It is working fine for me, does it depend on what citation format you're using?
  9. This is a broad and abstract feature request (i.e. something that would be appropriate only for a major redesign of Alfred's UI). As a former Quicksilver user, one of the things I loved was the <object><verb><modifier> design pattern, e.g. something like <john><email><file>. While Quicksilver used a linear set of UI panels, Raycast uses an inline popup for the [object][modifier]. With Alfred, due to its amazing versatility, we can present results as a list and get some of the benefits of this [modifier] pattern, but I suppose what I'd like is a "standard" pattern design, something "built-in" and consistent across tools and workflows. I personally think the inline popup for Raycast is quite neat, but I'm sure there are other ways to build this underlying pattern into a design...
  10. V1.3.4 released: https://github.com/iandol/bookends-tools/releases/tag/V1.3.4 Changes: A few releases back (~V13.2), Bookends added a dedicated Quick Add Applescript command. I couldn't get it to work in the background at the time and continued to use GUI scripting. Thanks to a hint from @bcdavasconcelos I realised it was a problem in my code, and this works fine in the background, so I upgraded bequickadd to use this more efficient and reliable command method. Also a tweak for betobibtex, if there is a parsing error when pandoc-citeproc tries to convert the BibTeX output to JSON (e.g. your citekey/user1 field is empty), the user will be warned with a display notification and the BibTeX will not be deleted so the user can check it.
  11. Released V1.3.3, focussed on the Scopus Search tool: https://github.com/iandol/bookends-tools/releases/tag/V1.3.3 Update the applescript interface used to control Bookends to use the new events system that is faster and fix an error. Improving error checking when fetching the scopus API data, and working round an annoying Ruby crash when the system proxy is set (we just bypass the proxy for now). Added a new environment variable scopusBaseURL to specify a replacement base url prefix, if for e.g. you access Scopus through a proxy. For example, the default address is https://www.scopus.com but my institution accesses through https://www-scopus-com-443.webvpn.las.ac.cn/ so I set that and URLs get rewritten to use the new base URL.
  12. Hi Vitor, yes, I just realised I had a misspecification problem in my rescue block. Spitting out JSON for the error message also makes a lot more sense. Thank you!!!
  13. Actually, when Ruby errors, then the workflow halts and the other Alfred options blocks do not run. I have the line that errors wrapped in an exception block: begin response = Net::HTTP.get(uri) rescue Net::ReadTimeout => e response = '' end But I see this in the debug: [07:39:35.463] ERROR: Bookends Tools[Script Filter] Code 1: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/uri/rfc3986_parser.rb:67:in `split': bad URI(is not URI?): "127.0.0.1:16005" (URI::InvalidURIError) from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/uri/rfc3986_parser.rb:73:in `parse' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/uri/common.rb:234:in `parse' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/uri/generic.rb:1542:in `find_proxy' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:1109:in `proxy_uri' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:1096:in `proxy?' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:936:in `connect' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:930:in `do_start' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:919:in `start' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:605:in `start' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:481:in `get_response' ... And then nothing gets printed from my debug block: ALSO, I realise that I cannot change the environment variables from within Ruby, as it is a child process so it only works on copies of the ENV sent to it from Alfred. I suppose I must modify the stdout to something that can be parsed to determine an error...
  14. I have a problem with ruby net:http library conditionally failing depending on whether the macOS system proxy is enabled or not. Currently my script just silently fails and Alfred shows the default searches. To know there was an error, one needs to go into the workflow editor debug mode. Does anyone have any tips how to handle script errors so they trigger a notification or some other method. My idea is to set an environment variable at the end of the script, and if that isn't set then Alfred's args and vars can do something conditional -- does that make sense?
  15. Sorry for the late reply, I don't check here very often. scopusSearch needs a DOI in the Bookends ref to work, and you may need to generate your own API key... EDIT: actually there was a small change in the Bookends Applescript interface that causes the grab-selected-DOI to fail. I will make a fix and update tomorrow.
  16. OK, well the voodoo that fixed this was: safe boot + reinstall the 10.15.4 combo update...
  17. Trying to run an Alfred workflow and I kept getting this error: Code 1: osascript: no such component "JavaScript". A google search turns up an Alfred forum post and linked think different post suggesting to delete ~/Library/Preferences/com.apple.ScriptEditor2.plist and reboot. But in my case it didn't solve anything. Not only Javascript is missing, Applescript too: Confirmed on the command line (osalang -l), although my Applescript and Javascript components are present in /System/Library/Components... ➜ osalang -l ...crickets ➜ ll /System/Library/Components total 0 drwxr-xr-x 8 root wheel 256B Jul 12 2019 ./ drwxr-xr-x 116 root wheel 3.6K Aug 1 2019 ../ drwxr-xr-x 3 root wheel 96B Jul 6 2019 AUSpeechSynthesis.component/ drwxr-xr-x 3 root wheel 96B Jul 6 2019 AppleScript.component/ drwxr-xr-x 3 root wheel 96B Jul 6 2019 AudioCodecs.component/ drwxr-xr-x 3 root wheel 96B Jul 9 2019 AudioDSP.component/ drwxr-xr-x 3 root wheel 96B Jul 9 2019 CoreAudio.component/ drwxr-xr-x 3 root wheel 96B Jul 6 2019 JavaScript.component/ I know this isn't an Alfred problem (though as most of my osascript is run via Alfred, this is where the problem manifests), but do any of you smart scripters have an idea of what I can do to fix this? A clean installed macOS 10.15.4 (19E287) on a mid-2015 iMac that was working pretty fine up till now. I tried reinstalled command-line tools just in case.
  18. I often want to get a selection from the current app to pass as argv to a script. Using the [hotkey] trigger this is trivial, but I normally want to be able to use both a [hotkey] and/or a [keyword]. Now the issue is [keyword] as an input does not support passing a "Selection in macOS" argument. The way I currently handle this is [keyword] triggers a script action Applescript to copy the selection (system events) to the clipboard then have two scripts, one that handles stdin via [hotkey] and one that uses the clipboard from [keyword]. But this seems a bit fussy (and fills up the clipboard in one but not the other trigger). I also sometimes use [hotkey] to also trigger an applescript>clipboard then have a unified script but we still are using the clipboard when we don't really have to. If we had a new dedicated [action] which simply passed the current selection to the next block it would elegantly solve this (my [keyword] would then trigger this new [action] to pass into a single argv script). I know this is fairly minor and there are workarounds and perhaps I'm missing a better way to do all this, but if not please consider adding this action, thank you!
  19. V1.2.9 is released: add a new workflow variable tempCitationStyle that sets the default temporary citation format for becite / betitle/ beall. When unset it will be the Bookends standard, but you can set the variable to Pandoc / MMD / LaTeX to paste the citation in a different format ([@key] / [#key] / \cite[]{key}). If the authors field is empty for a reference, we now try to use editor names instead in the Alfred results list.
  20. So my usecase is that my workflow interfaces with Bookends bibliography software, and a user can have 2 or more PDFs attached to a reference. Quicklook is designed to handle multiple files passed to it (you can test with qlmanage -p), and so it would be nice if the quicklookurl key in the Alfred JSON format would accept an array as well as a string. That way Alfred could pass multiple files to QL for previewing. Thanks for your consideration.
  21. Thank you vitor. So I hope Andrew will be able to update Alfred to read an array of paths to pass to QL. ?‍♂️?
  22. Hi, I have a new question: if I want to pass more than one file to QL via Alfred, is this possible, and how? This is possible for QL (pass multiple files via qlmanage -p for example), but Alfred may not parse the url string to pass as seperate items. On the command line (qlmanage -p) using a single string input, I tried separating within the string using space, comma, colon but none worked (you have to use multiple inputs). Thanks for any help!
  23. Updated to V1.2.8 which adds phrase search delimited by single quotation marks (without quoting words are searched in any location/order): https://github.com/iandol/bookends-tools/releases/tag/V1.2.8 Also just to remind you, if you want Quicklook to work, you should change the attachmentsFolder variable to point to your Bookends attachments path. All PDFs should be in the same folder, as it would be too slow to try to find the path automatically…
  24. @taja — does V1.2.5 handle the large results list? I've not tested with such a large number, but the error you show is the same as previously, and it doesn't make too much sense. It occurs when processing the author initial, but I've tested authors who have a comma after the family name but no first name or initials and it should work. I've added more defensive checks to try to not trigger this error. Please download the updated script manually and run it from the command line for testing or you can replace the version in your installed workflow: https://github.com/iandol/bookends-tools/blob/master/source/findReferencesAll.rb Let me know if it works, I don't think this is to do with lots of results, but references that have mangled author names or something, and that large search is revealing the issue...
  25. @taja — ok, the new author parsing didn't handle empty author fields, this wasn't an issue for becite, but was for beall. For the next release I should retrieve both authors and editors, and use editors if authors is empty, but I don't have time to do that for now, so author becomes "Unknown"... V1.2.7 released, please retest and let me know how it goes.
×
×
  • Create New...