Jump to content

iandol

Member
  • Posts

    166
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by iandol

  1. @vitor — thanks for the confirmation, and the excellent updater! @Cassady — I'm a bit confused, BE Tools already uses OneUpdater, the settings appear correct and all 11 tools are connected to it. So it should not need any manual configuration, but be triggered when any tool executes.
  2. Hi taja, OK that is my fault, I'll make an updated V1.2.5 soon. EDIT: V1.2.6 is released! https://github.com/iandol/bookends-tools/releases Cassady: actually I've never tested OneUpdater, so possibly I'm doing something wrong. @vitor — do these setting look OK (I normally set frequency to 4)?
  3. Haven't had a chance to play with it yet, but hopefully I'll get some time this week!!! ?
  4. I've just released V1.2.5, which presents the first AND last author names with initials to provide a bit more context for the search results. And I realised that I can get Quicklook for attachments working in Alfred (thanks to input from vitor and deanishe). This is really cool: so you search, focus a results item with an attachment (denoted by the ?) then press [shift] or [⌘][Y] and you can quicklook the PDF directly without Alfred losing focus so you can check the paper before inserting the citation. https://github.com/iandol/bookends-tools/releases/tag/V1.2.5 — or wait for OneUpdater to update for you.
  5. As always, Alfred is one step ahead of me, thank you so much!!!
  6. We can already quicklook normal Alfred entries, but I would really like to be able to quicklook entries in the script filter output. I realise this is not straightforward, in that the script filter JSON would need to be modified contain a new field that would be the file target Alfred would then send to `qlmanage -p` — but if we could select an filter entry, ⌘Y it and get the quicklook window without losing focus of the Alfred list it would be phenomenal. My idea is that if there is no JSON entry or it is empty, then ⌘Y does nothing (i.e. nonbreaking backwards compatible), if it is present and a file path, then QL that file. Thanks for your consideration!
  7. Thank you!!! So my wish now is to add this information to the Help page: https://www.alfredapp.com/help/features/clipboard/
  8. Hi, for those of us that use browser-extension password tools (lastpass, bitWarden, 1password etc.), these mostly work by using the clipboard (extensions don't seem to be able to tag clipboard contents as sensitive and cannot be added to the exclusion list). This means sensitive passwords can end up in the clipboard manager. I know we can Clear last 5/15 mins but sometimes we may forget and don't want to blitz our whole history... I was wondering if we could add the ability to delete single clipboard entries. I envisage in the Clipboard viewer we could focus an entry then use a modifier like [⌥][↵] to delete just that entry? Thanks for considering this.
  9. Just released V1.2.4 — becite/betitle/beall now shows if a reference has an attachment, and for Bookends 13.x users use the new applescript JSON events that are slightly more efficient.
  10. Hi @taja, do you normally use ⌘⇧O to do this? I tried to make it automatic (use ⇧ and ref opens and attachment if present otherwise nothing) but the problem is if there is no attachment it opens an attachment from the previously selected ref that does have an attachment even though a reference without an attachment is selected... I added it using another modifier [fn] — can you test if V1.2.3 does what you want it to? I've now used up all available modifiers (⌘, ⌥, ⌃, ⇧ and [fn])!
  11. V1.2.2 released, with only a small fix for the new API of the Scopus Search tool...
  12. No longer a beta, V1.2.1 released with a new tool beall that searches in any database field (we are now fast so it seems ok). ⇧ pressed for becite/betitle/beall will open ref directly in Bookends...
  13. I managed to get my Ruby rewrite nice and fast by optimising the number of times I must call bookends (I use an ASCII code 30 [\u001E] record separator). It now takes around 0.3secs, and it doesn't matter how many results are returned; for example for this large search (returns 471 records) we are clearly faster than before, and the Ruby code is much easier to maintain and modify. ./findReferencesTitle.rb "V1" 0.15s user 0.09s system 70% cpu 0.334 total ./findReferencesTitle.applescript "V1" 0.80s user 0.73s system 66% cpu 2.307 total findReferences.rb --------------------------------------------------------------------------- I've released a beta version of the workflow with the new faster becite/betitle/bebib tools. I've added multiple author search and an option YEAR to refine the search. So for example [friston hobson 2014] will search for references with authors "Friston" AND "Hobson" published in 2014. If someone tries this can you please let me know if it works for you... bookends-tools-beta.alfredworkflow
  14. @deanishe — I translated the applescript into Ruby, but there is substantial overhead of firing up osascript to run an apple event. The same query in Applescript takes substantially longer in Ruby (scales with the number of records I need to return) ./findReferences.applescript Lamme 0.14s user 0.15s system 66% cpu 0.448 total ./findReferences.rb Lamme 2.67s user 2.19s system 65% cpu 7.436 total This is what takes the time, it is the same loop for each database record in Applescript and Ruby (showing the ruby version): def getRecords() return unless @cansearch @list.each_with_index do |uuid, i| ti = osascript <<-EOT tell application "Bookends" return «event RubyRFLD» #{uuid} given string:"title" end tell EOT @title[i] = ti.chomp.strip au = osascript <<-EOT tell application "Bookends" return «event RubyRFLD» #{uuid} given string:"authors" end tell EOT @authors[i] = au.split(',')[0] da = osascript <<-EOT tell application "Bookends" return «event RubyRFLD» #{uuid} given string:"thedate" end tell EOT @date[i] = da.chomp.strip.split(' ')[0] end end # this converts to -e line format so osascript can run, pass in a heredoc # beware this splits on \n so can't include them in the applescript itself def osascript(script) cmd = ['osascript'] + script.split(/\n/).map { |line| ['-e', line] }.flatten IO.popen(cmd) { |io| return io.read } end I looked at some micro-optimisations (thinking perhaps IO.popen could be improved, see https://gist.github.com/koffeinfrei/3f8b88fb5b80ee665761) but nothing made much of a difference. Anyway, I can group the database items together to minimise the number of times I call osascript which should be a major win (I can do this for applescript also), but as utterly terrible as Applescript is, for very few specific tasks (like this one that calls many apple events and returns quickly back to Alfred), it still has its place. I really wish Apple took automation seriously enough to have kept rubyOSA, pythonOSA and Javascript moving forwards in the OSA architecture , but these are all in various states of bitrot and abandonment... :-(
  15. deanishe is bang on the money (i.e. correct)! I inherited this Applescript which string constructed the results list, and it is vulnerable to stray characters like the Langacker 2003 reference above; the datefield has a newline in it. Your Arendt database also contains a malformed date in ref Arendt #76260 — you can find these in your database by using an SQL search (⌘⇧S) in Bookends with a query string: thedate REGEX '\n' — the date field in Bookends is not so easy to parse as you can put in a mix of month day year in any order but there is no need for a newline there. If you want to sort on date, you should always put year first... Anyway, in the interim, I have fixed this so the newline or other stray characters are removed from the date field. You can redownload the workflow V1.1.1 or wait for the auto-updater to kick in. At least with your Arendt database it now works (takes about 4 seconds to parse all the Arendt refs into Alfred) I planned to rewrite this script in Ruby, although I worry about the performance hit as it has to call many applescript events to pull data from Bookends. To stick to Applescript I don't want any external dependencies and I only found https://github.com/mgax/applescript-json - @deanishe do you have any advice for a better JSON solution in Applescript?
  16. @w.yaqoob — does this depend on particular characters, like accents in author names? how big is your database? if you could find some references that reliably don't get found, you could make a small database and I can test... Did this get worse recently or it has never worked for you? @swilcox — I just downloaded 13.0.5, and becite seems to be working for me... Toy you BOTH: If you have some terminal skills, you can test the script itself by downloading https://github.com/iandol/bookends-tools/raw/master/source/findReferences.applescript and running it directly from the command line; make it executable then run it: osascript -s ho ./findReferences.applescript AUTHORNAME I may make a version that has a debug mode to try to make it easier to test it. There are a couple of lines 21/22 that start --do shell script "echo — if you remove the -- this will copy the SQL search text and results to a text file on the desktop which may help to determine what may be wrong. GENERAL: I am going to update becite / betitle to do a multi author / word search, and in the case of authors you can put an additional year to narrow the search further. It will be quite easy to update the script, but I just need to find time to do it; but I think it will make the search more useful...
  17. I would prefer paste as default too, could this be controlled with filters and a user variable?
  18. chaxu443: for single authors this is possible, not for multiple authors; but I'd suggest to use Live Search in Bookends directly as it is much more powerful (combine author and year or keywords etc.). You can trigger Live search from Alfred by using tool [3] berefsearch without a text selection then type authors years or whatever else you like.
  19. I've added a new tool, bequickadd that lets you select a DOI/PMID/ISBN/JSTOR tag in any app/broswer and pass it to BE's new Quick Add feature, which automatically adds that reference to the database. This nice feature is new to BE 13.0.3...
  20. Actually I don't use them myself, I thought it would be a nice addition to the default search results for new Alfred users who may use Network, iCloud, Recents etc. It isn't possible so no worries! I had naively assumed that the Search scope was custom built by Alfred (like in Quicksilver); I think what you are saying is that it still uses spotlight metadata then subindexes based on that (and obviously caches that for speed etc, which is why we must be careful adding stuff to Search scope).
  21. Oh that is a shame, it would be nice if Alfred could override this for explicit single folder locations in the Search Scope . i.e. if you add /Applications then it will certainly not enter the bundles (I understand why it does this), but if you explicitly specify /Applications/Test.app/Contents/MyMagicApps/ then it would scan only that folder? That would enable those useful Finder apps to be useable in Alfred.
  22. Actually I added /System/Library/CoreServices/Finder.app/Contents/Applications to my Search Scope and it is not populating the search with these apps, it has been at least 5 hours since I added it and I tried a "Clear Application Cache" and restart of Alfred, any ideas?
×
×
  • Create New...