Jump to content

robwalton

Member
  • Posts

    48
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by robwalton

  1. Thanks for the challenge. I only work on projects which I have some personal interest in though; and I have plenty of 'real-world problem-solving' to get on with already! Sorry.
  2. Hi @Altimor, @dfay, @EvanLovely & @Joel a, Thanks for the error reports. I've fixed this in v.1.0.4 to GitHub. Please let me know if it all works as expected and I'll push to packal. (The update to Ulysses 13 changed the file format of the plist file used to describe each group to a binary format not supported by the built in python library. At some point this thing will probably fail terminally as it ties in below Ulysses' supported API.)
  3. HI @jpal, unfortunately the `un` command does not append. I've removed the suggestion that it does from the doc. It would be a great feature, but I recall it being very difficult to add. The workflow reverse engineers the data structure stored on disk, and this does not give access to Ulysses note's UUIDs required for appending to a note via x-callback. Sorry. If I start using Ulysses again sometime in earnest I'll give it another shot.
  4. I've added a ticket to GitHub as this is a good idea: Add modifier key to open group or sheet in new window .
  5. How would a ulysses temporary 'context' work? I'm finding myself spending more extended periods working in one group than I used to. I'm imaging two new commands: * usc -- Select a group to act as a search-limiting context and open that group; no argument to clear. * uc -- Open a sheet or group from within the search-limiting context; warns if no context set. Would anyone else use this? or any better suggestions!
  6. Thanks for the positive feedback. I've started using Ulysses after a bit of a break and I'm just remembering how the workflow works again!
  7. This forum is a good place to ask questions. I'm not always that active, but seem to be ramping up again. I'm also likely to start using TaskPaper again, so that might help.
  8. Hi @40-02, @apoc527, @dfay (thanks for the stack trace). Thanks for the reports that the workflow is broken with Ulysses 12. I had the same problem. Try this new release v1.0.2. Please let me know if it looks okay and I'll upload it to Packal later and close issue. Thanks. EDIT: updated link to v1.0.2 as I've also fixed the 'uo' command to work with the new app name (although this one always has mixed results and I've tweaked the way it wants for ulysses to be ready to receive cmd-O.
  9. Hi @dfay, have been out for a while. How goes it? I had an attempt at packaging up something to make x-callback-url calls and then receive the callbacks. You might try https://github.com/martinfinke/xcall from the command line. I've put a python wrapper around it here: https://github.com/robwalton/python-xcall . I've not really used it in earnest, or checked it for race conditions or threads safety and whatnot. But it might help and it has tests so we might be able to improve it if you come across any issues! It may also be total overkill, if you've found a lighter way @dfay. I wanted something signed with apple that could be distributed easily.
  10. Whoops! Thanks for spotting that. No tests for those bits. Have fixed the workflow on master. Will have to start thinking about a release when it settles down.
  11. Hi again, I tried pretty hard to reproduce by firing off call from threads in parallel, but seemed okay. I haven't checked if xcall is thrad/process safe yet, but a quick glance in the code makes me think not. For this, and your issue, python-xcall now throws an AssertionError if it finds xcall already running. There is 20-30ms period after making one call where a second will still go through though. It should help a bit--and it might help you diagnose want wrong for you? The real solution is (from the outside of xcall at least) is a file lock--but those cause so much grief!
  12. Thanks @dfay, I'll get this bit working in the workflow first. I think that in bringing in the x-callback stuff, given the lack of tests in the workflow, I'll run old and new next to each other for a bit with some assertions. May still be a bit until I add your new commands, as will be working on foundations. Thanks for your ideas, work and debugging to date! --Rob
  13. Hi there, just integrating the x-callback stuff into ulysses workflow. I think I will go back to supporting iCloud only for now as this seems more trouble than its worth (unless you got further analysing it?)
  14. Thanks Python tutor . I've fixed this on my local development version (it did feel a bit clunky at the time). I have a huge project in my day job which would could probably do with using defining package APIs in __init__s. Will look at that too. I did a huge refactor of that a while back to make it less Java-like, but I guess I still missed some Python tricks. BTW, is there is there a good way to get Alfred to run off a git repo's working copy? Now I ask it: I guess I could just replace my e.g user.workflow.A661A55B-8CCD-4E74-BC15-54528262B74E folder with a symbolic link to my git working copy?
  15. Uh oh! I must have called it thousands of times with automated testing and haven't noticed this. But I noticed sometimes when calling ulysses with a wrong id there are long delays in returning. Possibly there might be other causes of this too. I wonder if your issue might be caused by making a call before another has returned and it all getting out of sync? I'll see if I can reproduce. Also, you mentioned a while back: I've not seen a problem with this one. Even if you request new token, old ones seem to keep working.
  16. I've extracted the xcall part of ulysses-python-client into a separate project python-xcall. I think this could be quite a handy tool and I'll try and put this up on PyPi if I can work out how to distribute the lib folder including Martin's xcall.app. Seems like pip wheels are the key! Then maybe after doing some actual work I'll include your ul command @dfayinto the ulysses workflow this thread is supposed to be about
  17. The vote came in for Boaty McBoatFace I'm afraid.
  18. Thanks. Using xcall is an easy way to handle things and Martin signed it too so no brainer to use it. I haven't profiled it to see how much overhead there is in firing it up every time---in principle leaving the url-callback receiver part running would be quicker---but it seems to be fast enough. 100ms to Ulysses and back again for most calls most of the time. Good spotting! I've fixed that. Totally agree. I was a bit shy about taking the package name ulysses which is partly why it was awkward. Have followed your suggestions. I just need to do something useful with it now (like ul @dfay), to see what needs changing about the API.
  19. Hi @dfay, Looks like you've made good progress on the ul command. I've gone off on one and pretty much finished a full ulysses python client to the 23 calls described here and put it up at github. Example use: >>> from ulysses_client import ulysses >>> ulysses.get_version() u'2' >>> token = ulysses.authorize() >>> ulysses.set_access_token(token) >>> library = ulysses.get_root_items(recursive=True) >>> print library[0] Group(title='iCloud', n_sheets=0, n_containers=4, identifier='4A14NiU-iGaw06m2Y2DNwA') >>> print '\n'.join(ulysses.treeview(library[0])) ... Will use it (or about 5% of it!) to add an append command to the workflow and also your cool ul workflow fragment fairly soon. I was all fired up to replace all calls in the Ulysses workflow with this (rather than the reverse engineered file system parsing approach it currently uses). However, it would be hard or impossible to replace the uf find command at his point. This command currently uses spotlight to find the location on disk of entries who's internal content matches a query; and then uses this list of file locations to filter the richer structure built up from reverse engineering the library. The problem is that it would currently take a call to ulysses.get_quick_look_url(id) on every single node in the tree obtained via x-callback to get path that backs each node. (The Ulysses API has no find call.) I'll ask the Ulysses guys about this, but with this version of the Ulysses API it doesn't seem like I can do a full replacement---was hoping this would fix the muddle with 'On My Mac' items and provide access to external folders without more reverse engineering (also its always nice to throw away fiddly code!)
  20. This would be a very cool feature. I guess we'd just want to paste it at the cursor location of the currently open sheet? I loose track of keyboard modifiers: would this warrant a new ul (for link) command?
  21. Sond like there are two issues: 1. The workflow should only look in 'On My Mac' if preference is set. 2. I don't see the 'On My Mac' prefixes that you see. Is it possible you once enabled 'On My Mac' and had some stuff in there? The workflow will find old things on disk---this would not account for everything having 'On My Mac' in front, but could cause confusion Will look at #1. Regarding #2, could you check that you don't have stuff in 'On My Mac' that be causing confusion P.S. Could just disable On My Mac support until I have time look at it properly. This was just a stepping stone to supporting external folders.
  22. So I tried this out and unfortunately Ulysses won't send callbacks to html schemes. I asked Ulysses technical support and got a very quick and helpful answer. This is a deliberate choice for security reasons. They pointed me at a command line utility they'd made for calling a url scheme and getting a callback xcall. I'll go with this. Thanks for the suggestion though, it would have been tidy and self contained.
  23. It is a URL callback and that looks like a good library, thanks. I'll give it a go. If it worked it would bypass a lot of cruft (I have an old school fifo pipe in the mix too)---it depends, I guess, on wether ulysses is happy sending its callback's to an http server rather than a locally registered url application scheme tied by OSX to a specific application (described here).
  24. I've started work on a ulysses python client on github. Need to work out how to create a call back receiver which is quicker: it currently takes .4s which adds up. Looks like you can leave an NSApplication running in an app bundle running rather than depending on AppleScript firing up each time as it does now (example).
  25. I've uploaded a new version 1.0 to packal and github. Big improvements are the addition of uf find command to search inside content and the introduction of fuzzy searching (from @deanishe's workflow) to other search commands. Don't know I lived without those two @katie. Also updates Alfred-Workflow to fix hanging in Sierra and add's @dfay's code for opening or importing files--no appending yet.
×
×
  • Create New...