Jump to content

RecentlyAdded — List directory contents by added date


Recommended Posts

Posted

@vitorThanks for the quick response. Your use-case makes a lot of sense. With your proposed solution, how would I handle the creation of new folders in a directory? Add them manually each time? I frequently add new projects and save files into those various folders. Without needing to manually add each folder as it is created, is there a way to open the scope to search the entire directory and sub-directories? Perhaps this wouldn't be implemented into your official workflow, but any tips on opening it open and tweaking it myself to use in my specific workflow?

Posted
15 minutes ago, vitor said:

Thank you both for the kind words!

 

It may help to understand my design goals for this specific workflow. As with @sepulchra, this is one of my most used and I tweaked it a lot to get to the current speed. The way I see it, the objective is to get as fast as possible into the contents a couple of directories and do some organising. E.g. It shows ~/Desktop and ~/Downloads, I open the most recent download—a zip which unpacks to the Desktop—then access the new thing on the Desktop to move somewhere else / change its name / grab a file from inside / … You can see why speed is crucial, I open it a bunch of times. And what’s important are the immediate children of the folders.

 

With that in mind, while those specific changes wouldn’t fit I do think you can get (closer to) what you want.

 

@sepulchra You can already kind of search for filetypes—but only one at a time—by typing the extension. E.g. if I type png scree I see all the Screenshot pngs on my Desktop.

 

@thisisb What you can do is add those frequent subdirectories to the directories Workflow Environment Variable. I will eventually turn that into a proper Alfred 5 File Picker configuration, before adding to the Gallery.

Thank you! this makes a ton of sense. And again -- this thing is FAST!

  • 2 weeks later...
Posted

Hello,

 

I have been an avid user of your workflow for years. But I recently upgrated to MacOs 13, and the workflow stopped working. Here is what I get in the debugger:

 

[12:38:09.440] ERROR: RecentlyAdded[Script Filter] Code 126: /Users/cedric/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/9E2D9F43-89B8-461E-ACAD-0AF96EE4D44E: line 1: ./recentlyadded: Permission denied

 

I use the 2022.2 version. Any idea?

 

Thanks!

  • 3 weeks later...
Posted

I had this workflow going fine until my computer had to be wiped and Ventura installed fresh.  Now every time I use rda in Alfred 4 I get this error message:  Directory does not exist! Check your configured directories.

 

I'm not sure what changed. I don't remember configuring directories before; it just worked.  When I go to the Alfred 4 preferences->Features, the search scope looks right... that is, all my home folders are included in the search scope.

 

Any ideas what I can do to get this workflow back up and running?

 

 

Screenshot 2023-04-04 at 5.37.31 PM.png

Screenshot 2023-04-04 at 5.37.04 PM.png

Posted

Open the workflow in Alfred Preferences and click the [x] at the top right. Then Switch to the Environment Variables tab. You should see something like:


directories      ~/Downloads, ~/Desktop


You have to set the directories there. In the next release of the workflow, this will be easier to set up.

Posted

Thank you for the quick reply.  I'm sorry I must still be not understanding because when I do what you suggested, those directories are listed already exactly as you wrote.  And yet rda will not list the most recently added files to my ~/Downloads directory.  Do I need to click the "Don't Export" checkbox?

 

I read in an earlier post that you suggested that someone's upgrade borked their permissions and you told him/her to reinstall the workflow.  I can try that if you think it will help.

Screenshot 2023-04-05 at 8.55.02 AM.png

Posted

Yes, completely uninstall the workflow and install it again. But first, make sure Alfred as Full Disk Permissions under System Settings → Privacy & Security → Files and Folders. If it does, remove it an add it again (macOS is sometimes wonky with permissions).

  • 2 months later...
Posted

Thanks again, Vitor.  I have tried everything you suggested with no luck.  I checked the Full Disk Permissions:

 

image.thumb.png.bf5693d7eebf3e78842fc37f4bd666d6.png

 

Then I deleted the RecentlyAdded Workflow completely and reinstalled it.  It is version v2022.2.  Next I went to the Environment Variables as you suggested:

 

image.thumb.png.71349db69d2c9256ef26b453c408f168.png

 

After all this I even quit Alfred 5 and started it back up.  When I try to run rda I still get this:

 

image.thumb.png.65a056e412f22330643e05f8672bbac0.png

 

I wouldn't keep bothering you about this but this is one of my favorite workflows!  I would love to get it working again.

 

image.png

  • 5 months later...
Posted

@JBullard I ran into the same issue this morning after discovering this workflow while googling for help on creating a similar workflow for my own use. I installed the workflow having never used it before and it failed the same way you described (Directory does not exist! Check your configured directories). I confirmed that the default directories were already listed in the environment variable and found this post describing the same issue. Posting since I got it to work with a slight modification of @vitor's suggestion above. 

 

I did have to grant Full Disk Permission to Alfred, but it looks like maybe Apple moved where that granting takes place. Rather than doing it under System Settings → Privacy & Security → Files and Folders, there Full Disk Access section by itself under System Settings → Privacy & Security. I added Alfred there and the workflow immediately started working. Posting in case someone else runs into the same issue. (I'm running Sonoma 14.1.2 FWIW.)

Thanks for the great workflow and now I'll spend some time trying to create one I was hunting for before.

  • 1 month later...
Posted

This workflow is awesome. Is there a way to get the first result of the items array, via automation? My end goal is to make an automation to grab the latest added file to a folder and add it to the app Yoink, which has its own applescript script that runs in Alfred (it's script is below).

 

on run argv
    set pathArray to {}
    repeat with theString in argv
        set theFile to POSIX file theString as alias
        set end of pathArray to theFile
    end repeat
    tell application "Yoink" to open pathArray
end run

Posted
5 minutes ago, Amusing4091 said:

This workflow is awesome.


Thank you.

 

6 minutes ago, Amusing4091 said:

Is there a way to get the first result of the items array, via automation?


There’s an Automation Task for that.

Posted
25 minutes ago, vitor said:

There’s also Most Recently Added Path.

Oh, yeah, that one replaces both of those commands... don't know how I missed that one. Thanks again!

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...