![]() If someone tries this can you please let me know if it works for you. So for example will search for references with authors "Friston" AND "Hobson" published in 2014. I've added multiple author search and an option YEAR to refine the search. I've released a beta version of the workflow with the new faster becite/betitle/bebib tools. applescript "V1" 0.80s user 0.73s system 66% cpu 2.307 total 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. 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 record separator). 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. I looked at some micro-optimisations (thinking perhaps IO.popen could be improved, see ) but nothing made much of a difference.Īnyway, 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. Tell application "Bookends" return « event RubyRFLD » # end This is what takes the time, it is the same loop for each database record in Applescript and Ruby (showing the ruby version):ĭef getRecords () return unless. findReferences.rb Lamme 2.67s user 2.19s system 65% cpu 7.436 total Bookends latest version: Bookends: A Powerful Reference Management App for iOS. findReferences.applescript Lamme 0.14s user 0.15s system 66% cpu 0.448 total Bookends for iPhone, free and safe download. The same query in Applescript takes substantially longer in Ruby (scales with the number of records I need to return) Version 14.2.2 Reference management and bibliography software. Please write to Or, Click here to chat with the Simpl Team.I translated the applescript into Ruby, but there is substantial overhead of firing up osascript to run an apple event.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |