Jump to content

h2ner

Member
  • Content Count

    33
  • Joined

  • Last visited

  • Days Won

    2

h2ner last won the day on September 8 2018

h2ner had the most liked content!

About h2ner

  • Rank
    Member

Recent Profile Visitors

2,597 profile views
  1. I’m not sure if since my first post there have been any changes or additional features that might help. To better explain what I’m hoping for: I have a script filter that searches a database and returns results. Relevant results could be at least several dozen and sometimes a hundred or more. Just like a search engine, I tend to often look at several to a dozen or two of the most relevant entries, perhaps refining search and continuing. Ideally, a script filter could persist its state so the next time I run it, it doesn’t requery the database but is reinvoked with the same query text filled in if I wish to edit the text, the filter results list is the same, and cursor and scroll position is also the same so for example I could easily just scroll down one and choose the next result if let’s say there’s 100. Sometime there was the addition of using AppleScript to call Alfred from an external script. With persistent variables; can I perhaps set the query text as some variable and then have an action before my script filter that calls it with the previously saved query text stored in a variable? My preference is to use the external trigger mode bound to a hot key as like a search engine I may invoke it repeatedly to look at dozens of results. Is it worth the possible addition of a toggle so that script filters can persist state upon successive invocations? I imagine some may wish to do something similar, use a script filter repeatedly to examine numerous results while refining the search.
  2. I realize removing peewee would give me great gains. If it's something like .15–.2+ seconds to return results for a script filter, there is a visible delay. I'm pretty novice at programming and my workflow was meant to be able to work out of the box with sqlite, but usable with other databases such as postgresql. Full-text searches with relevancy ranking over two full text indices in two tables; after enough records postgresql FTS became slow so I added sphinx. Maybe I could figure it out without an ORM though there'd be more code, more to maintain, and so forth. I'm not sure if I'm ready to do that yet and maybe some lightweight ORM-like library in Go, though indeed more complicated as you say, may work better. There may be other reasons too to want to switch. My workflow works fairly well enough as is for me, though performance certainly could be better, though it's a good amount left to do before release whenever that happens.
  3. Indeed the SQLite module would be much more responsive. At the time a few years ago, I had tried to optimize it as much as I could using peewee and considered it a bit slow. Gotten used to it since then but now revisiting it, maybe an eventual port to Go would be worth it. I'd possibly still use some ORM or ORM-ish library thought it should be better.
  4. The main workflow I use and perhaps the only one I spent any significant time on uses peewee. Agree native sqlite support might not be worth adding. It's configured to work on install using sqlite but optionally with postgresql & sphinx for full-text search. Currently searching 1 million+ records with sphinx and running at the terminal 'time' a script filter using your alfred-workflow returns results in ~0.15 seconds. I'm a novice at python, haven't profiled it in a while, haven't done any dev on it in a while, just got back to it, and am unsure if it's function calls, peewee initialization, db driver overhead, etc., I'm unsure what constitutes that time. I'm now looking at porting it to Go for more speed. It's not too bad but certainly faster is better. In a quick comparison of various ORMs, I found peewee easier to use and not to bad to write code to use various db backends.
  5. Agree with deanishe and was thinking the same: cmd-return to open in Contacts. I didn't know of cmd-O until I found this thread. As the modifiers control and option offer other options, I think cmd is a good choice for perhaps the most often wanted other action.
  6. Perhaps there hasn't been much consideration. Labels/tags are possibly going to be more important and utilized; see how they occupy a primary place in Files for iOS. If they were displayed in Alfred, a bit like Gmail for iOS, right aligned in a colored box with label name on the same line as the file path, I don't think that'd be too intrusive.
  7. In the develop branch, starting to add support for Sphinx. No setup instructions yet since I'm still figuring it out myself. PostgreSQL remains the easiest way to get full functionality yet at some point, not sure when, if the DB of imported bookmarks gets large enough where search results are no longer almost near instant, a separate full-text search engine such as Sphinx becomes faster.
  8. Gnosis Read (ἀνάγνωσις, anagnosis) more; seek to know (γνῶσις) more. Gnosis. Navigate ePubs and PDFs by TOC bookmarks – sections/chapters – for currently open file or search all bookmarks and open an ebook to that page, chapter, or section. Preview, Skim, and Acrobat for PDFs; calibre-viewer for ePub. Alfred 3. Usage Config Optional workflow environment variable : DB_ENGINE=postgresql (some instructions in README.md, default is sqlite) Commands .gnothis - search and go to bookmarks for currently opened ePub or PDF .gnosis - search and go to any bookmark for file type : PDF when in PDF viewer, ePub when invoked from calibre-viewer. .gnoall - bookmarks of any type .gnoedit - edit ePub (in BBEdit, later configurable) Command-line /usr/bin/python gnosis.py -c - remove bookmarks for deleted files /usr/bin/python gnosis.py -i ~/folder - batch import Install https://github.com/gennaios/alfred-gnosis/releases Notes As this is my first workflow and first python project, who knows what needs to be done, changed, or improved. Unsure of what may change as others provide feedback. DB of stored data may change; migrations may be possible or a bit of work. Be prepared to if necessary manually edit SQL tables or reimport; the only loss would be sort order of previously viewed bookmarks. I hope that won't be necessary. Todo Some planned, others who knows: better ePub 2 support for files sometimes differently structured; ePub 3. PostgreSQL search all matches by bookmark entry title, section (Part 1 … > Chapter 1 … > Section > …) and file name; SQLite currently searches only by title and section, severely limiting search results. Any help with that would be appreciated. cover thumbnails As it is live search against a DB, search all query times on my setup are a bit slow. May investigate other full-text search engines such as Sphinx. PDF annotations auto cleanup no longer valid bookmarks from deleted files browse calibre library?
  9. Given Alfred's UX, indeed I do not hope for the power that's possible with an entirely different UX, yet the original scenario mentioned, wanting very very very very much to return to the previous state of a script filter, with same results and scroll position, plus a query string history if possible, stands. Rerunning the previous query could take time; if it were possible to cache state given some time out and restore, that might work. I'm not quite sure if I understand, having only started workflow dev, but I'll think about it. I'm not using an ET but a hotkey bound to a script filter; perhaps that too is part of ET mode. I don't know if there's any current way to export the query string to some variable or preference (that part yes) and then prefill the script filter with the last used string, maybe through some run script between the hotkey and script filter; I may do that if possible though a future browsable query history, or better that plus restore state, is very much more preferred. Yes, thinking about it, agree per-workflow history might be troublesome, but a hotkey to show some type of history list would be great. The mentioned other app that also permits cmd-space to fill in a previous string could be nice as well though I haven't thought much about if an item history + search string history would be more useful and how it might look.
  10. The info concerning dimensions of 256px is very helpful. Thank you deanishe. It is easy enough for me to experiment to find out when an icon is shown as is in place of an icon of filetype. I had only tried with large JPGs; and indeed perhaps it is determined by some size limit. If someday the workflow docs could be updated, as well as either a link or mention in your excellent alfred-workflow, that'd be terrific. I'm unsure of the reasons why Andrew decided to resize images without keeping aspect ratio. If it is merely a question of not having looked into it, here is some info to save him a bit of time looking it up: https://stackoverflow.com/questions/2531812/trying-to-resize-an-nsimage-which-turns-into-nsdata
  11. hello deanishe, I'm trying to understand then what constitutes an icon. I tried passing (large) .jpgs and saw generic file type icons. Currently looking through a few installed workflows, some use .png. If I need to generate PNGs or even icon files, I can, may, and likely will eventually do that. The docs, the last time I looked, weren't clear.
  12. Hello, I've tried to search previous threads but was unable to find very much. I am curious about icon type fileicon in filter results. In the cases I've tried so far, I get only a generic icon; in limited testing, .jpg, .pdf, and .epub show only generic type icons. Perhaps some would depend on thumbnails from a quicklook plugin, yet for others if there is a Finder generated thumbnail, is that used? If needed, I could generate and cache my own thumbnails, and that may be necessary. In default queries results outside of a workflow, file icon thumbnails would be wonderful as well, though perhaps that hasn't been implemented because of caching, performance, or some other reason. There is also the question of aspect ratio. At least in some other workflows, I've noticed they are resized as a square; perhaps related to how the UIImage is currently generated. If needed, if I generate my own thumbnails, I could pad them, though it is possible to have Alfred resize while keeping aspect ratio.
  13. I'm hoping that script filters can be more robust and comparable to how one would use other search engines. There are filters that can return dozens, hundreds, or thousands of results. With many other search engines, one wants to act on numerous results while refining the query. If one has a filter that returns a hundred results, with the filter rerun and highlighting the first result (if using the up arrow), finding ones previous place with scroll position is more difficult. Plus, what prompted this thread in the first place, when calling filters from a hot key, unless I've missed some setting, the up arrow does nothing for me. On a related note, it would be also helpful to see a history of query strings for a particular script filter, or even a list of previous entered strings for all filters + previous items (web searches, files, folders, …) From what I've found, up arrow seems to be the only form of history save clipboard. Workflows is what made me attempt to switch from another app, yet I continue to use another for such features as history. In another, cmd-B will show a history of previous items. Plus when using another search, shift-space will fill in the text from a previous search, handy when wanting to enter in the previously used string into another search or filter, such as when wants to use the same string against multiple web searches.
  14. I also have reservations about including filter results in default queries but it is an interesting idea. Even if results were cached, given the number of workflows some have, results could be in the thousands, tens of thousands, hundreds, or millions. But perhaps if there was some cache time, and if only previously actioned items (with return) were included, that might be interesting.
  15. Hello, In my current in progress script, I might use a script filter to query some data, act on some result, and then wish to return to the same filter and pre-fill the previous query string, either to look at other results, or refine the query. I haven't yet tried to see if text can be passed to a script filter; in that case, I could save the text, and fill it to perhaps rerun the query. if it works, that could be an option for now. Currently, I'm copying and pasting. Perhaps a future option could save history for each filter, and perhaps even optionally bring up a filter in the previous state with queried results and scroll position.
×
×
  • Create New...