Jump to content

Recent Documents / Apps ?


Mpco

Recommended Posts

This workflow can list documents and apps opened recently.
Especially, it can list files opened recently by the foremost app.

System: macOS 10.11+

 

Github: https://github.com/mpco/Alfred3-workflow-recent-documents

 

Usage

You can press Enter to open the file in result, or press ⌘CMD-Enter to reveal it in Finder.

Tap rr to list files opened recently by the foremost app.

For example:

  • Recent folders will be listed when Finder is foremost.
  • Recent rtf, text files will be listed when TextEdit app is foremost.
  • Recent *.sketch files will be listed when Sketch app is foremost.
  • Recent *.xcodeproj project files will be listed when Xcode app is foremost.

The subtitle of each result consists of ⏱modified time and ?path of the file.

rr

Tap rf to list recent folders.

Opening recent folders is very common in use. Tapping rf is a more efficient way, even though you can activate Finder and then tap rr.

rf

Tap rd to list recent files.

These files were recently opened by user, not like rr which is just for the foremost app.

rd

Tap ra to list apps opened recently.

ra

Exclude folders from the results.

You can add private folder pathes separated by colon : to the Workflow Environment Variable ExcludedFolders. The results will not show private folders and any files inside them.

For example: ~/privateFolder1/:/Users/G/privateFolder2/

 

 

 

 

 

 

 

 

 

 

Edited by QqzgpCAo
Link to comment
  • 1 month later...
  • 3 weeks later...
  • 3 years later...
  • 3 months later...
  • 2 months later...

For some reason this extremely useful workflow has stopped working for me. For example, when I type “rr” I get “Restart Apple Remote Server” and when I type “rr + Space” I get “Search Google for 'rr'.” I am using the latest versions of Alfred and Monterey.

Link to comment
Just now, pubay said:

I am using the latest versions of Alfred and Monterey.

 

Debugging tip: never say “latest” but always the exact version. “Latest” isn‘t specific enough (latest beta, stable, pre-release?), can be wrong (auto-updater hasn’t kicked in), and makes it impossible for anyone to know if their version matches the report. To receive informed help, it is imperative to provide precise information.


For anyone to have a hint of what may be going wrong, open the debugger, set the log output to “All Information”, perform the failing action, and post the output.

Link to comment

I am using Alfred 5.0.3 and Monterey 12.6.

 

Here is the output from the Debugger:

 

[09:51:40.833] Recent Documents / Apps[Script Filter] Queuing argument '(null)'
[09:51:41.303] Recent Documents / Apps[Script Filter] Script with argv '(null)' finished
[09:51:41.303] Recent Documents / Apps[Script Filter] {"items": [{"title": "None Recent Record for the foremost app","subtitle": "(*´・д・)?"}]}
[09:51:54.466] Recent Documents / Apps[Script Filter] Queuing argument '(null)'
[09:51:55.364] Recent Documents / Apps[Script Filter] Script with argv '(null)' finished
[09:51:55.364] ERROR: Recent Documents / Apps[Script Filter] Code 69: You have not agreed to the Xcode license agreements, please run 'sudo xcodebuild -license' from within a Terminal window to review and agree to the Xcode license agreements.
[09:51:56.557] Recent Documents / Apps[Script Filter] Queuing argument '(null)'
[09:51:57.319] Recent Documents / Apps[Script Filter] Script with argv '(null)' finished
[09:51:57.320] ERROR: Recent Documents / Apps[Script Filter] Code 69: You have not agreed to the Xcode license agreements, please run 'sudo xcodebuild -license' from within a Terminal window to review and agree to the Xcode license agreements.
[09:56:00.602] Logging Started...

 

Do I need to run 'sudo xcodebuild -license' in the Terminal?

Link to comment

I ran the command in Terminal, and now I get the following output from the Debugger (with Mellel as the foremost application):

 

[08:49:15.307] ERROR: Recent Documents / Apps[Script Filter] Code 1: Traceback (most recent call last):

  File "/Users/rolfgiebel/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.29AF8104-0541-463F-AD11-1D034CDF5812/main.py", line 215, in <module>

    allItemsLinkList.extend(itemsLinkList)

TypeError: 'NoneType' object is not iterable

[08:49:15.308] Recent Documents / Apps[Script Filter] #ERROR: [Errno 1] Operation not permitted: '/Users/rolfgiebel/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.redlex.mellel5.sfl2'

[08:49:15.308] ERROR: Recent Documents / Apps[Script Filter] JSON error: JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0. in JSON:

#ERROR: [Errno 1] Operation not permitted: '/Users/rolfgiebel/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.redlex.mellel5.sfl2'

 

File Search is also not working – it reverts to “Search Google for……”

Link to comment
  • 1 year later...
Posted (edited)

Hi Stephen. Yes, and thanks for the reply. It's specifically the recent docs for the front app feature that I miss. 

I think it's to do with the fact that the workflow expects `.sfl2` files, but the extension seems to have been changed to `.sfl3`, which has probably also thrown the parsing off. I've had a look at `main.py`, but it's a bit over my head to be honest. 


EDIT: Wait, "Alfred includes over 60 default actions, such as copying to your Clipboard, saving as a Snippet, searching the web, showing recent documents for an app or extracting URLs from a block of text."

I had no idea about that! I thought it was just a general recent docs thing. Unfortunately it still doesn't work for the front app; you have to explicitly action an app and then see its recent docs. Still, I might be able to use that as part of a Keyboard Maestro macro... 

Edited by noisyneil
Link to comment

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