Jump to content

RecentDownloads — List and act on the contents of a directory


Recommended Posts

@vitor Thanks for this wonderful workflow! Probably the one I use the most!

 

I was wondering if you had the intention of adding an exclusion list? I have my Keyboard Maestro settings file in this folder and as it updates almost every day it appears at the top of the results. Of course, I could and certainly will move this file somewhere else. But still wanted to ask you this question as I suspect other interesting use cases for this feature 😀

Link to post
  • Replies 60
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

List the contents of a directory and act on them. Call the workflow with rdn to sort from the most recently modified, rdo for the reverse; rda to sort from the most recently added, rdz for the reverse

Yes, you can simply go to the workflow (via Alfred’s preferences), and change the keywords (you just have to double-click each Script Filter node and change the top line, to something that will not in

There you go. Added the two extra options for you.

Posted Images

8 hours ago, politicus said:

Thanks for this wonderful workflow! Probably the one I use the most!

 

Thank you for the kind words.

 

8 hours ago, politicus said:

I was wondering if you had the intention of adding an exclusion list?

 

I do not. I doubt many people would use it.

Link to post
  • 6 months later...

@vitor I would definitely echo @politicus statement about how awesome this workflow is! It's definitely near the top of my most used workflows.

 

Somewhat related to @politicus question about blacklisting items, is it possible to exclude temp/invisible items? I might be wrong, but the issue seems to be limited to Microsoft Word files. When I run your workflow, it always shows a handful of Word files that start with "~$". I notice them whether I run the workflow on my Downloads or Desktop folders, etc.

 

Thanks again for sharing the workflow!

Link to post
  • 2 weeks later...
  • 4 months later...

Update.


On deleting cache file, also ask Spotlight to reindex directory. This should make certain operations (like renames) quicker to show up correctly.


To update, download the latest version (same URL) or wait a few days and it’ll prompt you to on next usage, since it uses OneUpdater.

Link to post
  • 6 months later...

Hi Vitor, 

I've made very good use of your workflow in conjunction with the Hook App. 

I have it index a folder with a bunch of files that point to all of my projects, and voila - instant project management tool!

 

I just need to figure out an option to list the files simply in alphabetical order and I'll be happy. 

 

If you're interested, here is the small post i made about using your worfkflow: https://discourse.hookproductivity.com/t/using-hook-files-to-maintain-a-list-of-current-projects/2884?u=seishonagon

 

Thanks! 

Link to post

@seishonagon No plans to officially add alphabetical sort. But you can make a new Script Filter with language set to /usr/bin/ruby and paste the following:

 

require 'json'
require 'pathname'

script_filter_items = Pathname.new(ENV['downloads_dir']).expand_path.children.sort.each_with_object([]) do |entry, array|
  name =
    if entry.directory?
      entry.basename.to_path
    else
      entry.basename(entry.extname).to_path
    end

  array.push(
    type: 'file',
    title: name,
    subtitle: entry,
    icon: { path: entry, type: 'fileicon' },
    arg: entry
  )
end

puts({ items: script_filter_items }.to_json)

 

I offer that code, but no support for it (I tested it, and it worked).

Link to post

Oh wow! Thanks!

That'll save me some mind numbing slog. To give you an example of my own script-fu, I've just spent 2 hours figuring out how to pass arguments properly to the "Run Script" action in Alfred Workflow ...

 

EDIT: for future reference (mine, specially) - don't forget to set "Argument Optional" in the script filter or the list of files won't appear

 

Edited by seishonagon
Link to post
5 hours ago, seishonagon said:

To give you an example of my own script-fu, I've just spent 2 hours figuring out how to pass arguments properly to the "Run Script" action in Alfred Workflow


We’ve all been through it! The quintessential example is forgetting a semi-colon, though I doubt that particular example happens much with the checks we have today.

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...