Jump to content

Norris

Member
  • Posts

    11
  • Joined

  • Last visited

Norris's Achievements

Helping Hand

Helping Hand (3/5)

0

Reputation

  1. Found it! I was setting the script as "Script Filter Input" instead of "Run Script". Put that code in Run Script and now I can modify the "{query}" through bash. It's simple when now that I know how
  2. Thanks for the help! Could you please point me to documentation or provide an example that would help me achieve this? I've tried to do this: query=$1 if [ -z "$query" ] then echo -n $(pbpaste) else echo -n $query fi And then assign the output of that to a named Alfred variable but that didn't work at all. I have a 2 step workflow: read {the_id} - after you hit return it captures the value as variable ID and displays a list of read options from Alfred's "List Options". When the option is selected - passes the ID variable to a URL and opens it up. I can't find anything similar to that in the documentation. The workflow I'm creating is already working great with a simple "read {the_id}", but I'm trying to find a way to auto-populate {the_id} when it's not specified.
  3. I'm making a workflow that sets an argument to a variable, but I'd like to make it optional and use the last copied item instead (if the Query is empty). So for example `read 102931` - Specify the ID (which usually is copied from somewhere) But also accept `read` and that would automatically populate the `ID` variable in the workflow with `102931` from Clipboard. Basically, I want to do this in an Alfred workdlow: $var = $query; if( empty( $var ) ) { $var = $clipboard; } echo $var;
  4. That doesn't exactly solve my problem. Have another look at the example above more closely. If I enter "th theme2" in Alfred, it's going to allow me to pick from all of the folders called "theme2" in "~/Sites", which could be docs sub-folder. I need a way to tell Alfred only to return the results that end with "/themes/theme2"
  5. Looks like Alfred 3 might finally support the feature I'm looking for, but I have no idea how to achieve it. What exactly I'm trying to achieve: I have a lot of local development sites ( more than in this specific example ) ~/Sites/site1/subdir/themes/theme1 ~/Sites/site2/subdir/themes/theme3 ~/Sites/site3/subdir/themes/theme4 ~/Sites/site4/subdir/themes/theme2 ~/Sites/site5/subdir/themes/theme5 ~/Sites/site6/subdir/themes/theme2 ~/Sites/site7/subdir/themes/theme2 // And there are many, many more of these: ~/Sites/site7/subdir/themes/theme2/docs/theme2.html ~/Sites/site7/subdir/themes/theme2/docs/theme2/resources/style.css ~/Sites/site7/subdir/themes/theme2/docs/theme2/resources/app.js I often want to jump directly to "~/Sites/site7/subdir/themes/theme2" or "~/Sites/site33/doodle-dir/themes/foobar". All of my themes have 1 thing in common - they're the direct child of a folder named "themes/", which is why I thought I could filter for that through RegEx (see below). Returning everything (or even only folders) named "theme2" isn't going to be much help to me. Here are the steps I took to make my workflow: 1. th {name} - reveals all folders matching {name} in "~/Sites" directory 2. [hit return button] - Like the "Dynamic file search" example sets the results to a variable 3. [File Filter] - This should let through only paths that contain "something/something/themes/{name}" ), I've set it to match regex: "(?!themes\/)[\w\d-_]+$" for {path} variable 4. Return a list of directories that have passed the file filter, so that I can select one of them an open in finder At first I thought I can just copy the "Dynamic File Search" workflow and replace the Workflow JSON with Filter, but that doesn't work for me. Any pointers how to properly use the filters ? Is this even possible ?
  6. Is there a way to "unfuzzy" a folder ? p.s. By the way - this is currently the lifesaver for me. Thanks!
  7. Thanks for the elaborate reply Andrew! The problem in my case is that I have multiple "Vacations" folders and it's not so easy to target them.The vacations was a really simplified version of what's actually going on. What I have is more like this: /Users/N/Sites/project1/wp-content/themes/project1-theme/project1.sublime-workspace /Users/N/Sites/project2/wp-content/themes/project2-theme/project2.sublime-workspace /Users/N/Sites/project3/wp-content/themes/project3-theme/project3.sublime-workspace On top of that, I have: /Users/N/Dropbox/Projects/Publishing/project1/project1.zip /Users/N/Dropbox/Projects/Publishing/project1/project1_sources/ /Users/N/Dropbox/Projects/Publishing/project2/project2.zip /Users/N/Dropbox/Projects/Publishing/project2/project2_sources/ /Users/N/Dropbox/Projects/Publishing/project3/project3.zip /Users/N/Dropbox/Projects/Publishing/project3/project3_sources/ My projects are automatically zipped & copied to my Dropbox folder in Publishing when I publish something, and I like to keep them there for duplication. I could exclude those folders, but I would have to do that for each project, targeting specific folders, because I also have /Users/N/Dropbox/Projects/Publishing/project3/project3_stuff_that_I_dont_have_anywhere_else/ Path filtering would solve all my troubles, even if it were to work only on the first 50 results. The initial alfreds search query is almost always "close enough" for me. - Adding filters would let me access the correct file quicker, instead of "open project3 ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ⏎" I don't want Alfred to replace spotlight or to be a "full search engine", I just want to get to the files that I need a bit quicker...
  8. I actually wouldn't mind a fully blown path search at all! That would be an awesome feature to have. 90% of the time when I open files, I know exactly which file I want to open and where it is. For example I want "/Users/N/Pictures/Vacations/Paris/sitting in a cafe.jpg" and not the picture where I'm sitting in a cafe in Rome or Madrid. So typing "open pic par cafe" would be really badass! However, about a year ago I already came up with the suggestion and from what I understood at the time was that it Alfred doesn't keep track of the paths out of the box ( it just pulls them up as needed ), and keeping an index of everything that way would slow everything down. I might be mistaken, I don't know this for sure, but that's how I remember it. And that made me think of this alternative way on how do to it - it's basically the same thing, but in a reverse order ( you get to filter paths when you've pulled them up ) Of course some core functionality modification is needed ( like possible responding to keywords after the first words or such ), which is why I posted this in the features suggestion
  9. David, just as Tyler - you're imagining it as a "new kind of a search" that is very complicated and very specific. It's not. When I type "open changelog" right now I see: See? The Paths are already there! All the necessary info for the filter is already there! All I want is a way to filter by the paths already available to me. That's why I wrote it in the feature suggestions. All the other ways are "workarounds" that require me to tag, categorize, etc. before I can act, but a filter like this would be very easy to add on and make a huge difference.
  10. Thanks Tyler, While I appreciate Fuzzy Folders, I think it's only halfway there. In order to open changelog.txt from mysite.dev right now I have to: 1. Install Fuzzy Folders 2. Setup msite.dev to be a fuzzy folder 3. Set a keyword for my fuzzy folder 4. Now type "myfuzzysite changelog" 5. Find the changelog file out of the 9 results that I see there Next time I have to add another folder, I will occupy another "keyword" and will have to repeat steps 2-5. And right now I have to repeat steps 2-5 for the 10 folders I already have. It's a workaround. Not a solution. This is how a solution looks like: "changelog mysite somelib" I understand that might bring up some fuzzy issues, so adding a new keyword would work too: "lookfor changelog mysite somelib" Where alfred would use "lookfor" as a keyword ( configurable, I'd replace the default ' or f with that ) to trigger fuzzy path filter. Note that I'm not suggesting a Fuzzy Path Search, where Alfred would have to constantly keep track of all file paths on the system. That would probably be terrible for performance. I'm suggesting that already found results ( find changelog ) could be further filtered by path ( find changelog filter:mysite ).
  11. I'm loving alfred since the beta releases. And since that time one thing has been bugging me - alfred search results. I'll give you an example: When I type "open changelog.txt" I get all sorts of results, however all I wanted was to view a changelog.txt file that I've created. I'm a web developer, so I use tools of others (node_modules) and others also have their changelog.txt or changelog.md, etc. files - as a result I'm left at the mercy of the "smart filter" that alfred has, which is proving not to be as smart sometimes. So with 'open changelog' I get a list of all sorts of stuff: /some_game/libs/changelog.txt /sites/other-domain.com/tool2/changelog.txt /sites/other-domain.com/tool1/changelog.txt /sites/mysite.dev/changelog.txt /sites/my-other-site.dev/tool1/changelog.txt I've narrowed the example down to 5 results. Spotlight says I have around 130 "changelog.txt" files currently on my system. Often enough I don't even see the file I'm looking for in results 1-9 ( for cmd+number access ). This is extremely problematic to me. And it's not only changelog files. It's the 'wp-content' or 'themes' directory for wordpress ( I have 19 of them right now ), and so on So - the suggestion: Introduce a filter for alfred search results. I don't care what the interface looks like, I could easily use 'open changelog --path mysite.dev' or 'find mysite.dev then changelog.txt' or 'find themes in mysite.dev' or even 'mysite dev changelog' All I know that there must be a way to filter down the search results. Currently it only works for the filename, but the problem is that my filenames repeat themselves quite a bit. Alfred does a really good job of finding my files, I see a bunch of changelogs already when I type "open cha". If I was able to do "open cha -filter mysite" alfred would be the ultimate productivity tool for me as I'd be able to access the files I need in seconds.
×
×
  • Create New...