vitorgalvao / alfred-workflows

Collection of Alfred workflows
BSD 3-Clause "New" or "Revised" License
2.44k stars 167 forks source link

Changing downloads_dir env variable causes workflow to stop working #117

Closed modermo closed 3 years ago

modermo commented 3 years ago

Setup info

Description of issue

I love the functionality of this workflow and was hoping to apply it to other folders as well. So, I tried duplicating the workflow, changing the workflow shortcut (so as not to conflict with the others) and changing the environment variable downloads_dir to ~/Desktop but I keep getting the below result upon execution of the shortcut.

Debugger output

12:14:10.003] ERROR: RecentScreenshots[Script Filter] Code 1: ./recentdownloads:35:in `initialize': no implicit conversion of nil into String (TypeError)
    from ./recentdownloads:35:in `Pathname'
    from ./recentdownloads:35:in `<main>'
vitorgalvao commented 3 years ago

Double click the Workflow’s name on the Workflow list and fill the Bundle Id line.

Bundle IDs are meant to be unique, so duplicating a Workflow makes it blank. That ID is also used to determine the Workflow’s cache and data directories, so because it is blank they don’t exist.

Thank you for making a clear bug report. It made it straightforward for me to find the culprit.

modermo commented 3 years ago

The Bundle ID does actually fix the crashing issue, but typing in the new shortcut for the duplicated workflow still opens the Downloads path even after changing the downloads_dir variable to something like ~/Desktop.

Do I need to "refresh" the workflow? I tried exporting and reimporting, but it still opens the Downloads directory.

modermo commented 3 years ago

Duplicate the workflow and then change the downloads_dir to another path. Is it opening your new path?

vitorgalvao commented 3 years ago

Download the latest version, just released.

modermo commented 3 years ago

That fixes it! Thanks so much for the amazing speed at which you turned the fix around. This is a brilliant workflow!