Jump to content

cdpath

Member
  • Posts

    23
  • Joined

  • Last visited

Posts posted by cdpath

  1. The keyword for Snippet Trigger is not exported, so the user who installs a workflow that uses Snippet Trigger has to set the keyword himself; otherwise, the workflow will not work at all. (Case: https://www.alfredforum.com/topic/19464-write-down-url/ )

     

    The process could be made easier if the keyword for Snippet Trigger could be configured through the Configuration Builder, for example, using {var:keyword}.

  2. Anki Search Workflow

     

     

    Download: https://github.com/cdpath/anki_search/releases/tag/v0.0.3

    GitHub: https://github.com/cdpath/anki_search

     

    anki_search.thumb.png.3ffa9684350a235d98d377c806e05ca8.png

     

    Setup

    • Front Fields: Specify fields for search results' titles.
    • Back Fields: Specify fields for search results' subtitles.

     

    Usage

    • Use as to search notes. Hit `ENTER` to open results in the Anki Browser.
    • Use at to list all tags.

     

    Dependencies

     

  3. Get item URI from frontmost application as markdown format

     

    Credits:

     

    Highly inspired by [Hook – Links beat searching](https://hookproductivity.com/) and my previous workflow(which is triggered Snippet Trigger)

     

     

    Use case:

     

    Let's say you are writing some blog and want to insert some reference links. You can simply hit Shift-Command-C in Chrome to get the title and link of web page in 

     

    [title](url)

    format.

     

     

    Supported Apps:

    • DEVONthink 3
    • Obsidian
    • Zotero (require zotxt)
    • Chrome
    • Safari

     

    Todo:

     

    • Support more URI format, for example HTML <a> tag or RTF
      • But I'm not sure what's the best way to do so, maybe with Action Modifier?

     

     

    Download: https://github.com/cdpath/copy_link/releases/download/v0.0.2/Copy.Link.alfredworkflow

    GitHub: https://github.com/cdpath/copy_link

  4. Found the bug finally. In the purple Run Script below, I actually passed nothing to the next action (only send content in pbcopy) , which means the following Copy to Clipboard has nothing to do.

    Meanwhile, with regex ^((?!(ulysses)).)*$, the third branch is selected too.

     

    image.thumb.png.a50ffbbd0829a07eb705b86aa170e6f0.png

     

    Yet still cannot figure out why branch 2 and branch 3 together can ACTUALLY works...

  5. 2 hours ago, Vero said:

     

    Make sure you've checked the "Automatically paste to front most app"

     

    clipboard-output-example.png

     

    Cheers,
    Vero

     

    Yeah, I checked both Automatically paste to front most app and Mark item as transient in clipboard

     

    The wired thing is, with anything else unchanged, the regex in else (the filter utility) can affect the behavior of the second branch (the one with Notes, Evernote, scapple).

     

    regex cause problem: ^((?!(ulysses|Notes|Evernote|scapple)).)*$

    regex that works fine: ^((?!(ulysses)).)*$

  6. 29 minutes ago, deanishe said:

     

    The Key Combo should come after the Copy to Clipboard, not be alongside it. The way you have them set up, Alfred will run them simultaneously, and it's just luck that the clipboard is set before the key combo is triggered.

     

    I got your point. I simply put Key Combo alongside Copy to Clipboard to give some illustration (misleading, though 😂). 

     

    Without the Key Combo, the Copy to Clipboard alone still didn't work.

     

    Here is the updated workflow:

    https://github.com/cdpath/alfred_workflows/releases/tag/0.0.7

     

     

  7. I did some experiment. Here is what I found:

     

    Problem 1

    The regex Notes|Evernote|scapple actually works fine

     

    Problem 2

    I found Regular Expression to exclude a list of words and figured out the following regex to mimic fallback else

    ^((?!(ulysses|Notes|Evernote|scapple)).)*$

     

    So I got this:

    image.thumb.png.0c0f33b13bb6f0ace26a819e51ec63ba.png

     

     

    And something fancy happened. The second branch (Notes|Evernote|scapple) doesn't work anymore.  It seems Copy to Clipboard failed to paste the incoming content. I have to use Key Combo to fix it.

     

    I highly doubt it has something to do with the performance of regex in else branch: ^((?!(ulysses|Notes|Evernote|scapple)).)*$ . If I replace it with ^((?!(ulysses)).)*$ , everything works fine.

     

  8. Why I need this?

    Sometimes I just found myself repeating copy/paste URL and title from Chrome to write some reference.  Even worse, different apps accept different format (Yeah, I'm talking about you, Ulysses!).

     

    So here is my workflow:

     

    1845640409_Screenshot2018-11-1813_33_12.thumb.png.044000cd1c2345d747d52d716ad5690d.png

     

    Usage

     

    Just type 

    \\u

    in your favorite app.

     

    Problem

    1. I tried and failed to use matches regex in Filter Utility, that's why I have to hard coded three (and maybe more in the future) filter.

    This is my failed attempt: 

    Notes|Evernote|scapple

    2. The else (marked in red in screenshot above) is not actually fallback, which may lead to some bug. 

    # What I thought it would be
    if condition_a:
        ...
    elif condition_b:
        ...
    elif condition_c:
        ...
    
    # How it actually works
    if condition_a:
        ...
    if condition_b:
        ...
    if condition_c:
        ...

     

    Download

     

    https://github.com/cdpath/alfred_workflows/releases/tag/0.1.1

     

  9. 22 hours ago, deanishe said:

    Not as part of the snippet, no. Use a Keyword element to enter the parameter after the Snippet Trigger fires.

     

    12 hours ago, GuiB said:

    To expand @deanishe suggestion, there's a "Snippet Triggers - Getting Started" example in Alfred that would show you some ways to do what you want (especially the "hellomsg" snippet). Look into "Alfred Preferences -> Workflows -> [+] -> Getting Started -> Snippet Triggers".

     

     

    Thanks! Those built-in examples are really useful. I'll go through them all.

  10. On 8/1/2017 at 10:12 PM, deanishe said:

    Hmm. On my machine, the command returns when I close the window it opened (i.e. I can leave other MacVim windows open and the application running).

     

     

    I found a setting in MacVim,  'Quit MacVim' after last window closes. Now it works.

  11. 16 hours ago, deanishe said:

    Couple of suggestions:

     

    • The source code of your workflow isn't in the repo, only the Python script it uses. That makes it hard for people to make pull requests.
    • Why don't you use the /usr/local/bin/mvim -f <filepath> command to open the file? This waits until the user closes the window, so you know when the user has actually finished editing the file.

     

     

     

    Found a issue with MacVim 8.0 on macOS Sierra. When I `:wq` to finish editing, MacVim process still exists, and this workflow hang over there until I CMD-Q MacVim itself. So I have to use the following one to make sure MacVim is done, which, of cause will affect other MacVim window (if there is one).
     

    /usr/local/bin/mvim -f $filename && killall MacVim

     

    Is there a better way out?

     

    Thank you in advance!

  12. 4 hours ago, deanishe said:

    Couple of suggestions:

     

    • The source code of your workflow isn't in the repo, only the Python script it uses. That makes it hard for people to make pull requests.
    • Why don't you use the /usr/local/bin/mvim -f <filepath> command to open the file? This waits until the user closes the window, so you know when the user has actually finished editing the file.

     

     

     

    1. I've updated source codes in GitHub

    2. 'cos I don't know :ph34r:. I've rewrite the workflow according to your advice.

     

    Thank you!

×
×
  • Create New...