Jump to content

Recent files in a folder


Recommended Posts

Updated to v 1.1:

 

Shows recent files (sorted new to old) in a folder and opens the file, get file actions ,reveal in Finder or share via Dropox (requires WF http://www.packal.org/workflow/drop)

custom folders can be set in List Filter relative to home directory e.g. Desktop or Desktop:somefolder

Following actions are available: 

  • Enter → Opens file
  • ALT → Enters into File Actions
  • CTRL → Share via Dropbox (required Drop WF)
  • CMD → Reveal in Finder

 

http://www.packal.org/workflow/recent-files-folder

Edited by Acidham
Link to comment
  • 1 year later...
  • 3 weeks later...

Thank you, this is handy! Would it be possible to support custom date strings as shown in the results (“Added: date”)? Personally I would prefer the form YYYY-MM-DD. I realize that this can be done in the Python code, but it would be convenient if date formatting could be changed by e.g. a workflow variable or another easy way that does not require the users to tinker with the Python code. 

Edited by cands
Link to comment

I noticed that the results when invoking this workflow does not behave as ordinary Alfred results, e.g. result items (files) cannot be dragged to be copied to a folder and I cannot access File Actions as usual by pressing right arrow. This limits the usefulness somewhat. Is it possible to get the result items behave as standard? I'm on macOS 10.14.2 and Alfred 3.7.1. 

Link to comment
  • 2 months later...
  • 1 year later...
  • 2 weeks later...
  • 9 months later...

All the folders that are mentioned do have files in them.

 

I'm not sure what log you're talking about, but I just turned on the debugger and tried to use the Recent Files plugin again and copied the info below.

 

Thanks again for your help in getting this working.

 

Quote


[19:42:14.841] Logging Started...

[19:42:18.203] Recent files in Folder[Script Filter] Queuing argument '(null)'

[19:42:18.469] Recent files in Folder[Script Filter] Script with argv '(null)' finished

[19:42:18.474] Recent files in Folder[Script Filter] {

    "items": [

        {

            "title": "jret18",

            "subtitle": "\u23ce to list Files or \u2318 for addtional actions",

            "mods": {

                "cmd": {

                    "valid": true,

                    "subtitle": "Enter Action Menu",

                    "arg": "/Users/jret18"

                }

            },

            "arg": "/Users/jret18"

        },

        {

            "title": "Temp",

            "subtitle": "\u23ce to list Files or \u2318 for addtional actions",

            "mods": {

                "cmd": {

                    "valid": true,

                    "subtitle": "Enter Action Menu",

                    "arg": "/Users/jret18/Temp"

                }

            },

            "arg": "/Users/jret18/Temp"

        },

        {

            "title": "Downloads",

            "subtitle": "\u23ce to list Files or \u2318 for addtional actions",

            "mods": {

                "cmd": {

                    "valid": true,

                    "subtitle": "Enter Action Menu",

                    "arg": "/Users/jret18/Downloads"

                }

            },

            "arg": "/Users/jret18/Downloads"

        },

        {

            "title": "2021 unsorted",

            "subtitle": "\u23ce to list Files or \u2318 for addtional actions",

            "mods": {

                "cmd": {

                    "valid": true,

                    "subtitle": "Enter Action Menu",

                    "arg": "/Users/jret18/Dropbox/Drawers/The unsorted drawer/2021 unsorted"

                }

            },

            "arg": "/Users/jret18/Dropbox/Drawers/The unsorted drawer/2021 unsorted"

        },

        {

            "title": "Dropbox",

            "subtitle": "\u23ce to list Files or \u2318 for addtional actions",

            "mods": {

                "cmd": {

                    "valid": true,

                    "subtitle": "Enter Action Menu",

                    "arg": "/Users/jret18/Dropbox"

                }

            },

            "arg": "/Users/jret18/Dropbox"

        },

        {

            "title": "Distribution",

            "subtitle": "\u23ce to list Files or \u2318 for addtional actions",

            "mods": {

                "cmd": {

                    "valid": true,

                    "subtitle": "Enter Action Menu",

                    "arg": "/Users/jret18/Distribution"

                }

            },

            "arg": "/Users/jret18/Distribution"

        }

    ]

}

[19:42:29.199] Recent files in Folder[Script Filter] Processing complete

[19:42:29.200] Recent files in Folder[Script Filter] Passing output '/Users/jret18' to Arg and Vars

[19:42:29.241] Recent files in Folder[Arg and Vars] Processing complete

[19:42:29.242] Recent files in Folder[Arg and Vars] Passing output '' to Script Filter

[19:42:29.243] Recent files in Folder[Script Filter] Passing output '/Users/jret18' to Run Script

[19:42:29.287] Recent files in Folder[Script Filter] Queuing argument ''

[19:42:34.871] Recent files in Folder[Script Filter] Queuing argument '(null)'

[19:42:34.969] Recent files in Folder[Script Filter] Script with argv '(null)' finished

[19:42:35.008] Recent files in Folder[Script Filter] {

    "items": [

        {

            "title": "jret18",

            "subtitle": "\u23ce to list Files or \u2318 for addtional actions",

            "mods": {

                "cmd": {

                    "valid": true,

                    "subtitle": "Enter Action Menu",

                    "arg": "/Users/jret18"

                }

            },

            "arg": "/Users/jret18"

        },

        {

            "title": "Temp",

            "subtitle": "\u23ce to list Files or \u2318 for addtional actions",

            "mods": {

                "cmd": {

                    "valid": true,

                    "subtitle": "Enter Action Menu",

                    "arg": "/Users/jret18/Temp"

                }

            },

            "arg": "/Users/jret18/Temp"

        },

        {

            "title": "Downloads",

            "subtitle": "\u23ce to list Files or \u2318 for addtional actions",

            "mods": {

                "cmd": {

                    "valid": true,

                    "subtitle": "Enter Action Menu",

                    "arg": "/Users/jret18/Downloads"

                }

            },

            "arg": "/Users/jret18/Downloads"

        },

        {

            "title": "2021 unsorted",

            "subtitle": "\u23ce to list Files or \u2318 for addtional actions",

            "mods": {

                "cmd": {

                    "valid": true,

                    "subtitle": "Enter Action Menu",

                    "arg": "/Users/jret18/Dropbox/Drawers/The unsorted drawer/2021 unsorted"

                }

            },

            "arg": "/Users/jret18/Dropbox/Drawers/The unsorted drawer/2021 unsorted"

        },

        {

            "title": "Dropbox",

            "subtitle": "\u23ce to list Files or \u2318 for addtional actions",

            "mods": {

                "cmd": {

                    "valid": true,

                    "subtitle": "Enter Action Menu",

                    "arg": "/Users/jret18/Dropbox"

                }

            },

            "arg": "/Users/jret18/Dropbox"

        },

        {

            "title": "Distribution",

            "subtitle": "\u23ce to list Files or \u2318 for addtional actions",

            "mods": {

                "cmd": {

                    "valid": true,

                    "subtitle": "Enter Action Menu",

                    "arg": "/Users/jret18/Distribution"

                }

            },

            "arg": "/Users/jret18/Distribution"

        }

    ]

}

[19:42:41.614] Recent files in Folder[Script Filter] Processing complete

[19:42:41.616] Recent files in Folder[Script Filter] Passing output '/Users/jret18' to Arg and Vars

[19:42:41.617] Recent files in Folder[Arg and Vars] Processing complete

[19:42:41.617] Recent files in Folder[Arg and Vars] Passing output '' to Script Filter

[19:42:41.665] Recent files in Folder[Script Filter] Queuing argument '(null)'

 

 

Link to comment

Ok this output looks ok and list all folders. Did you press enter on a folder before you copied the log output? If yes which one?

 

please run again with log enabled and also choose a folder and copy paste the result.

Edited by Acidham
Link to comment

I have checked that several times but everything has been correct. I did upgrade from Alfred 3 to 4 a couple months back and had trouble with some workflows after that but I assumed that they were workflow issues, not something on my side. I did remove the permissions in all the areas and add them back again and restart Alfred but I have the same issue and get the same results in the log. Obviously it's something on my side but I just have no idea what the problem is. Where is it dropping the ball? The workflow is expecting to receive a list from finder but never gets it back to display it?

Link to comment

In the log that you sent in previous posts shows that the folders were properly responded back, and hopefully it will be shown in Alfred:

 

  • jret18
  • Temp
  • Downloads
  • 2021 unsorted
  • Dropbox
  • Dropbox
  • Distribution

Let's focus on one e.g. jret18: What happens when you press ENTER on that one? What is the log showing? Don't forget to have Alfred Workflow open with debugger enabled. 

If it fails there must be an error (written in red)

Link to comment
  • 1 year later...

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