Jump to content

gandalfsaxe

Member
  • Posts

    103
  • Joined

  • Last visited

Posts posted by gandalfsaxe

  1. 1 minute ago, robgill said:

    This workflow is amazing I use it A LOT.

    I've thought of an improvement, but when I looks at hacking it, I can't work out how to implement it. I was wondering if it would be possible to mimic the cases in Alfred. 
    For example, (see screenshot) instead of current options change this to:

    Title Case
    Sentence case
    UPPER CASE
    Capitalize
    lowercase

    or to be clear between Title Case and Capitalise, show an example

    Title Case (The Quick Brown Fox Jumps Over a Lazy Dog)
    Sentence Case (The quick brown fox jumps over a lazy dog)
    Upper Case (THE QUICK BROWN FOX JUMPS OVER A LAZY DOG)
    Capitalize (The Quick Brown Fox Jumps Over A Lazy Dog)
    Lowercase (the quick brown fox jumps over a lazy dog)

    But the first option would be ok for me just so I can quickly see CAPS!

    Screen Shot 2018-03-13 at 09.48.25.png

     

    I prefer keyboard shortcut to a keyword for this workflow, but I can see why others would prefer keyword.

     

    I use Cmd+Ctrl+Opt+Shift (yes all modifier keys) +

    * L (lower case)

    * U (upper case)

    * S (sentence case - but I almost never use this)

    * T (title case)

     

    In the beginning it felt a little like doing finger gymnastics (I use little, ring, middel and thumb for the four modifiers on the left, and index on right hand for the letter), but I've gotten used to it now. On the other hand, the heavy use of modifier keys, it never interferes with anything ?

     

    Anyway just for inspiration. Regarding your question, isn't it just a matter of connecting all the python scripts in the workflow to an Input -> Keyword, and then making the keyword titles that you want? See attached screenshots.

     

     

    Screen Shot 2018-03-13 at 11.19.31-800.png

    Screen Shot 2018-03-13 at 11.19.37-800.png

    Screen Shot 2018-03-13 at 11.19.45-800.png

  2. Ah sorry @vitor, I read your post too fast and thought you suggested System Preferences -> Dock -> Prefer tabs when opening document -> Always

     

    I now remember why this particular setting was a no-go for me:

    If I have multiple SublimeText windows open, and I relaunch the app, all windows are combined within one, meaning that I have two levels of tabs open. This is actually a really cool feature, if it was supported by SublimeText, but it isn't. This means that I have no way of recombining separate windows except for relaunching the app, cause *all* windows to recombine.

     

    As for:

    Finder Preferences → General → (tick) Open folders in tabs instead of new windows.

    - unfortunately, this doesn't even work for me. It makes no difference how this setting is set; Finder will always open folders in a new windows, regardless of whether I use Spotlight search or Alfred. Does it work for you?

  3. 7 hours ago, vitor said:

    If you want to always open new Finder locations as tabs instead of windows, regardless of context, go into Finder Preferences → General → (tick) Open folders in tabs instead of new windows.

     

    Thanks for the suggestion. I have had that option enabled sometime in the past, but I changed it back. Can't exactly remember why. But it does do what I want, if you can live with *always* having things open in tabs. I can't remember why it bothered me, so I think I'll change it back and see how it goes :)

  4. 30 minutes ago, deanishe said:

     

    Dude, I literally just explained how it has nothing to do with Spotlight or Alfred…

     

    How Finder opens folders is Finder's business. Alfred has no influence over that.

     

    I understand what you said, that's why I resigned to the situation and said "I'll probably survive then".

    I just said why I find it a little jarring when I can quick open files and folders in many text editor / note applications in a much better way, but not in my main file browser. I just find it lacking, though I now understand that there's nothing Alfred can do about it easily.

  5. On 2/7/2018 at 5:24 PM, dfay said:

    if you use BibDesk this is your best bet 

    which works much better than the later one by smargh , which has more features but is unusably slow with my master .bib with 6500 entries or so.

     

    otherwise you’ll need to include a library and parse the bibtex yourself in your language of choice 

     

    I don't use BibDesk, but I'm willing to try that workflow, either as a basis to modify or just use Bibdesk in addition to Mendeley (that is my reference manager of choice) just for the purposes of this workflow, if that could somehow work.

     

    However I'm getting a broken link when I try to download that workflow. Do you know where it moved to?

  6. Hi,

     

    I'm looking to build quite a simple workflow in Alfred that simply can suggest / autocomplete "citekeys" when I start typing, using a .bib file as it's basis.

     

    A .bib file is a BibTeX reference list, which is a plain text file containing a list of references formatted by the following scheme:

     

    @article{Salimans2017,
    abstract = {We explore the use of Evolution Strategies (ES), a class of black box optimization algorithms, as an alternative to popular MDP-based RL techniques such as Q-learning and Policy Gradients. Experiments on MuJoCo and Atari show that ES is a viable solution strategy that scales extremely well with the number of CPUs available: By using a novel communication strategy based on common random numbers, our ES implementation only needs to communicate scalars, making it possible to scale to over a thousand parallel workers. This allows us to solve 3D humanoid walking in 10 minutes and obtain competitive results on most Atari games after one hour of training. In addition, we highlight several advantages of ES as a black box optimization technique: it is invariant to action frequency and delayed rewards, tolerant of extremely long horizons, and does not need temporal discounting or value function approximation.},
    archivePrefix = {arXiv},
    arxivId = {1703.03864},
    author = {Salimans, Tim and Ho, Jonathan and Chen, Xi and Sidor, Szymon and Sutskever, Ilya},
    doi = {10.1.1.51.6328},
    eprint = {1703.03864},
    file = {:Users/gandalf/Library/Mobile Documents/com{\~{}}apple{\~{}}CloudDocs/-Sync/Mendeley/Salimans et al/Salimans et al. - 2017 - Evolution Strategies as a Scalable Alternative to Reinforcement Learning.pdf:pdf},
    isbn = {3-540-63746-X},
    issn = {1744-4292},
    pages = {1--13},
    pmid = {27474269},
    title = {{Evolution Strategies as a Scalable Alternative to Reinforcement Learning}},
    url = {http://arxiv.org/abs/1703.03864},
    year = {2017}
    }

    This example above is just one entry, there are typically many such entries in a file. The important part is the very first value near the top which is the citekey, here "Salimans2017".

     

    What I want is that I start typing "Sali" in Alfred, and that it suggests "Salimans2017" and paste it to the current text cursor in format "[@Salimans2017]".

    As a bonus feature I'd be nice to be able to search for a title, then getting the citekey for the selected match.

     

    Does anyone have any good idea of how to construct this workflow?

    It basically boils down to making suggestions / autocompletion for a list of keywords stored in a plaintext file, and then pasting these keywords in a slightly reformatted way. I've put an example of a .bib file with two references here: https://gist.github.com/GandalfSaxe/4ca72ed004b832f4721e5274e2f1bb48

  7. I have been using Alfred for switching between different apps for a long time.

    I have also found multiple desktop a useful way to cleanly separate different projects and have all the necessary apps, browser tabs etc. open for the different projects.

     

    However I have always been super annoyed with how macOS decides to auto switching between desktops when switching apps (or more precisely showing hidden applications). Today I found a solution: https://discussions.apple.com/thread/4995042?tstart=0:

    defaults write com.apple.dock workspaces-auto-swoosh -bool NO
    killall Dock

    I can finally use multiple desktops without frustration. My deepest thanks goes out to whoever shared this originally (the link in the thread above seems to be dead).

  8.  

    1.

    I'm trying to avoid using Alfred since I'll be changing Alfred itself, and therefor can't count on having Alfred workflows available when I swap sync folder.

    Can it be saved within an additional entry in com.runningwithcrayons.Alfred-Preferences-3.plist or is that risky?

     

    2. If I wanted to save these Applescript and bash scripts somewhere on the disk in user space, what would an obvious place to be for? I'm thinking, not Dropbox or Google Drive since I cannot count on that being installed. I'm also thinking I wouldn't want to clutter the user folder ~/ or the ~/Documents folder, but somewhere invisible, but obvious.

  9. That works, thanks.

     

    There's one final bonus feature I'm considering

    Now we have done switching to a sync folder that I can specify (global hotkey achieved with BetterTouchTool).

    What could be interesting would be to press another shortcut and it goes back to the previous sync folder, whatever that was. We'd have to save the value of syncfolder in the plist somewhere to do that.

     

    Any suggestions? In any case, thank both of you for your help, I now have the core functionality I was looking for.

  10. Thanks vitor. Well this is strange... it almost works, but doesn't:

     

    1. I quit alfred

    2. Change the value "syncfolder" of plist "com.runningwithcrayons.Alfred-Preferences-3.plist" the desired path. I can verify that it's been changed by opening and inspecting.

    3. Launch Alfred, all my workflows etc. are still there.

    4. A moment after I launch Alfred, the syncfolder property resets to it's old value. It's overwritten at launch with the old value instead of dictating new behavior.

     

    Any suggestions?

  11. 20 hours ago, deanishe said:

     

    The naming scheme is based on UUIDs by the look of the names (and UUIDs are common in macOS programming).

     

    Alfred doesn't care what the folders are called, however. I have a script that renames the directories after the workflow bundle ID, and Alfred is fine with that.

     

     

    Did you restart Alfred after you replaced Alfred.alfredpreferences?

     

     

    There's a syncfolder key in Alfred's preferences file (~/Library/Preferences/com.runningwithcrayons.Alfred-Preferences-3.plist).

     

    As long as you quit Alfred before changing it, I reckon updating that path will do the trick.

     

    I'm not sure that switching the Alfred.alfredpreferences bundle will Just Work, however, as there appear to be machine-specific preferences in there, too. So some of your settings etc. won't be applied, as they aren't associated with the new machine.

     

     

    No I didn't restart it. That should probably work.

     

    It sounds like a promising solution could be to have a script that:

    1. quit Alfred

    2. change sync folder in ~/Library/Preferences/com.runningwithcrayons.Alfred-Preferences-3.plist

    3. launch Alfred

     

    What is the easiest way to achieve this? Apple Script? Launcher via BetterTouchTool perhaps.

    I don't know so much Apple Script, can anyone get me started? :-)

     

  12. Thanks for the suggestions.

     

    It seems like the system responds within ~10 seconds when you move the workflows in/out of the folder. Not ideal, but an acceptable solution if nothing better comes up.

     

    1. Do you know how the naming scheme e.g. "user.workflow.FA536ACA-8101-4A71-90ED-2B54B90672E6" is decided? Is it some kind of hash value from the workflow title and contents? So I could assume that this name will very likely not collide with some other workflow name?

     

    3. However besides just the workflow, I'd actually all of the Alfred stuff (snippets, resources, features etc.) to be easily toggled. I did try to move the whole folder, but that didn't seem to work well (or at all). I just don't know what copy and what to leave inside the Alfred.alfredpreferences package. I want to move as much as possible, but at the same time, it should work reliably. Since moving just "workflows" worked semi-well, and all of Alfred.alfredpreferences didn't work at all, I don't know how much trial and error I'm willing to through. Any suggestions?

     

    3. Finally I also looked for the "Advanced" pane, in hope of digging up the "syncing folder" setting somewhere, which would supposedly solve all the problems, but I can't find it. Is it possible to set the syncing folder programmatically?

  13. Hi,

     

    Problem: I sometimes need to help family or friends with some stuff on their MBP. However, I'm much more efficient if all my usual Alfred workflows works. However my friends/family wouldn't want to have those workflows enabled all of the time.

     

    What I'm looking for: A global shortcut or Alfred workflow to enable/disable a set of Alfred workflows. I don't see any way to do it in Alfred itself, unfortunately. BetterTouchTool allows for a global shortcut to enable a specific profile, which is genius; with one keystroke I can enable a set of keyboard shortcuts that work for me when I use the computer.

     

     

    Any suggestions?

  14. 2 hours ago, atheos said:

    Unfortunately Netflix changed their internal API which I was relying on for searching. Looks like they are using a home grown variation on GraphQL which would be too big of a change to implement.

     

    That is the nature of internal APIs - no guarantees are made and they are changed often.

     

    While it might still be possible in theory to use the mobile app API (that one is still JSON last time i checked) I don't have any personal use for this workflow anymore and decided it is not worth my time and effort to maintain it.

     

    If you would like to take over development feel free to fork it on github.

     

    That's fully understandable :-)

     

    Perhaps you should edit the thread title to say it's deprecated now.

  15. On 1/11/2017 at 7:26 PM, dfay said:

    Here's a completely rewritten version (in Python) which combines the two workflows into one:

     

    https://dl.dropboxusercontent.com/u/6601556/Alfred/Case Converter 2.alfredworkflow

     

    It uses Alfred's built in Copy to Clipboard with automatic pasting to frontmost app instead of pbcopy in Bash and AppleScript pasting, which seems to give better results.  

     

    Works wonderfully! Much appreciated. You should update your first post with this if you haven't :-)

×
×
  • Create New...