Jump to content

Recent Downloads with Feedback


Recommended Posts

An Alfred workflow for opening or revealing the most recently downloaded items in “~/Downloads”.

 
 
The items are sorted in decreasing order according to when they were added to the folder. Items are filtered by whether they contain the query as a subsequence. The result is displayed using the feedback functionality.
 
 
Use config.yaml in ~/Library/Application Support/Alfred 2/Workflow Data/recentdownloads.ddjfreedom/ to control the new default behavior:

 

install_action: ask, install, open

auto_start: ask, always, never

 

Updated:
1. added the option to delete files (holding 'ctrl') (by fmr)
2. result's icon matches file's icon
3. added the option to move files to trash (holding 'cmd') (by fmr)
4. changed the default behavior of certain files: if the item can be installed (an application, an dmg file, a zip file containing those files, etc), the workflow will prompt the user whether to install it. After the installation, if the item installed is an application, the workflow will prompt the user whether to launch it.
Edited by ddjfreedom
Link to comment

Hey I suck at programming. Would you help on that? I tried installing your ruby gem but here is what i get:

 

 

ERROR:  Error installing nokogiri:
ERROR: Failed to build gem native extension.

 

xcrun: Error: could not stat active Xcode path '/Applications/Xcode45-DP4.app/Contents/Developer'. (No such file or directory)

 

 

(of course i get a whole lot more but these seem to be the most important ones).

I do have xcode installed as well as the command line tools.

Link to comment

Great workflow! Two suggestions:

 

  1. Would it be an idea to differentiate between files and folders?
  2. Could you filter out the Icon? file?. It shows up if you've set a custom icon for the Downloads folder?

One final remark: currently delete does not work for folder items.  

Link to comment
Hey I suck at programming. Would you help on that? I tried installing your ruby gem but here is what i get:

 

 

ERROR:  Error installing nokogiri:
ERROR: Failed to build gem native extension.

 

xcrun: Error: could not stat active Xcode path '/Applications/Xcode45-DP4.app/Contents/Developer'. (No such file or directory)

 

 

(of course i get a whole lot more but these seem to be the most important ones).

I do have xcode installed as well as the command line tools.

 

According to http://stackoverflow.com/questions/11961032/xcrun-error-could-not-stat-active-xcode-path-volumes-xcode-xcode45-dp1-app-c, you need to run

sudo xcode-select -switch /Applications/Xcode.app

 

And I've updated the link in the original post. Now delete works both on files and folders, and hoding 'cmd' to move item to Trash. You can also download it here: http://d.pr/f/te4d

Link to comment
According to http://stackoverflow.com/questions/11961032/xcrun-error-could-not-stat-active-xcode-path-volumes-xcode-xcode45-dp1-app-c, you need to run

 

 

sudo xcode-select -switch /Applications/Xcode.app

 

I tried that but get the following:

 

 

Building native extensions.  This could take a while...
ERROR:  Error installing nokogiri:
ERROR: Failed to build gem native extension.
 
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
 
 
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/nokogiri-1.5.6 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/nokogiri-1.5.6/ext/nokogiri/gem_make.out

 

 

 

I've sent a couple of pull requests - one for improved native handling of deletions and another to remove the  dependancy on nokogiri.

 

I'll look forward to that.

 

 
 
Link to comment

Hi, 

 

Very interesting workflow.

My problem is I do not see any items filtered.

 

I type this workflow keyword, "Recent Downloads" is selected 

then I type "enter". Then ... I can't do anything.

 

After typing "enter", I tried to insert the name of the latest download, it didn't work.

I even tried to type "enter", holding ctrl or cmd or option but my latest download

was still there...

 

I have nokogiri installed "require 'nokogiri' => True".

 

 

I am pretty sure I didn't understand how to make it work properly. 

Could you elaborate for the newbie that I am ?  :)

 

Thank you.

Link to comment
Hi, 

 

Very interesting workflow.

My problem is I do not see any items filtered.

 

I type this workflow keyword, "Recent Downloads" is selected 

then I type "enter". Then ... I can't do anything.

 

After typing "enter", I tried to insert the name of the latest download, it didn't work.

I even tried to type "enter", holding ctrl or cmd or option but my latest download

was still there...

 

I have nokogiri installed "require 'nokogiri' => True".

 

 

I am pretty sure I didn't understand how to make it work properly. 

Could you elaborate for the newbie that I am ?  :)

 

Thank you.

 

I'm not exactly sure why. One reason may be that folder

 

 

~/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data

 

doesn't exist. The workflow will store some data in a folder created in that folder, so if it doesn't exist, the workflow fails. 

Maybe you can use the newest build of Alfred 2. I think it will automatically create the folder. Or you can manually create it.

Link to comment

changed the default behavior of certain files: if the item can be installed (an application, an dmg file, a zip file containing those files, etc), the workflow will prompt the user whether to install it. After the installation, if the item installed is an application, the workflow will prompt the user whether to launch it.

 

 

Use config.yaml in ~/Library/Application Support/Alfred 2/Workflow Data/recentdownloads.ddjfreedom/ to control the new default behavior:

 

install_action: ask, install, open, cancel

auto_start: ask, always, never

 

 

new version is on AlfPT and http://d.pr/f/CAIi

Edited by ddjfreedom
Link to comment

A couple of things. 

 

- I just want to use the script to display the most recent downloaded file. I have no use for the install etc... action you have added. Which is nice but I had disabled that from the v1 script othijus shared.

 

1) Are there any plans to have the script be capable of going down at least one directory to deep for those of us who auto-organize downloads with apps like Hazel and Glims for Safari?

 

2) I am not getting accurate results. Default clean install of 10.8.2 with Xcode and command line tools etc... but I can go to macupdate.com - download 3 files in a row and they are usually mixed up a bit with older folders residing in ~/Downloads (2-5 days old) appearing before the just downloaded files.

 

What are your system specs? I never had these problems with otijhuis's extension for alfred v1 so I am not sure why the results I am receiving are so off. Any ideas? Ruby v1.8.7 (default 10.8 version)

 

Perhaps it is Ruby or something else, so please if you do not mind would you share your system specs with me so I can try to figure out what is causing this behavior?

 

And lastly, anyway we might see the script be able to filter down one level to view downloads organized into dated folders?

 

Thanks for sharing this! I really hope I can get it to work as I had posted a request for a script just like this 4 or 5 days before you posted this workflow. Cheers!

Link to comment
Thanks, very handy..

 

fyi, Recycle bin is showing up in the list for me :-)

 

Is that also hidden? I just filter out all file names starting with '.'. I'll fix this.

 

A couple of things. 

 

- I just want to use the script to display the most recent downloaded file. I have no use for the install etc... action you have added. Which is nice but I had disabled that from the v1 script othijus shared.

 

1) Are there any plans to have the script be capable of going down at least one directory to deep for those of us who auto-organize downloads with apps like Hazel and Glims for Safari?

 

2) I am not getting accurate results. Default clean install of 10.8.2 with Xcode and command line tools etc... but I can go to macupdate.com - download 3 files in a row and they are usually mixed up a bit with older folders residing in ~/Downloads (2-5 days old) appearing before the just downloaded files.

 

Just realized that it will always check if there are stuff to install. Sorry about this. I'll fix it.

 

1) Do you mean display items from Downloads folder and all its sub-folders? Or display items from Downloads folder and walking down folders? If the latter, I'll have to set folder's 'valid' key to "no", and no operation can operate on it.

2) The workflow uses

mdls -name kMDItemDateAdded -raw "Filename"

to get the time when an item is added to Downloads, and use this to sort the item. Because mdls is quite slow, the workflow caches the result in a file under 

~/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/recentdownloads.ddjfreedom

I'm guess the cache becomes inconsistent with the order of files in Downloads. Another possible reason is that the workflow uses file name as uid, maybe Alfred changes the results a bit.

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