Problem running auto-open rule for internet downloads

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

I was hoping to use Hazel to automatically open PDF files that I download from the internet. Generally speaking, if I want to save a downloaded PDF file long-term, I will choose to download it in a specific file on my computer. I only use the Downloads folder if it's something temporary--and which I almost always will access immediately. Below is the rule I attempted to write (also trying to attach screenshots but not sure that will work). However, the rule doesn't run, and in fact Hazel deletes some of the lines upon save (second screenshot). Any ideas if there's a way to fix this? Or is this just beyond Hazel's capabilities?

If ALL conditions met:
Source URL is not blank
Extension is PDF
Date Added is in the last 1 minute
THEN:
Open with application Default Folder (and bring to front)

[img]Screenshot%202024-03-09%20at%201.59.02 PM[/img] [img]Screenshot%202024-03-09%20at%201.59.10 PM[/img]
macrospecter
 
Posts: 6
Joined: Sat Mar 09, 2024 5:53 pm

You need to use a third party image hosting service if you don't already have a cloud service of your own. I suggest imgur.com.

I don't see how anything would be deleted with that rule. I suggest going through the troubleshooting guide here: https://www.noodlesoft.com/kb/hazel-tro ... ing-guide/
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thank you! I don't think the Troubleshooting tips help, unfortunately. I activated debug mode, but I am not seeing any new data recorded. Two followup questions.

1. I've realize that most of my rules are only working sporadically. Especially those for the Downloads folder. About 10% of the time when I manually click "run rules now" they will work. But most of the time they do not. I go to "preview rule" mode and it shows a match for the files I want to act on. But then no action occurs. (Very often, though not always, the action is something simple, too, like move to trash.) Is there some setting I might have failed to activate in order to make the rules work in the background or even to reliably work upon manual run?

2. Relatedly: The option to "run rules now" is often unavailable, especially for the Downloads folder. It's simply grayed out. I will try editing a rule, to see if it's just because the rule has recently been run, but that does not change the availability of the "run rules now" option. Is there any reason this might be?
macrospecter
 
Posts: 6
Joined: Sat Mar 09, 2024 5:53 pm

Please report with the rule status and logs.

If you activated "Run rules now" and it's greyed out, it's because it is still running. Again, the logs would indicate more of what's going on.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

I'm sorry, I'm not quite sure which logs you would like (they are very long!). But here are some from last round that contain errors. I have replaced my username with ** for privacy. The error about the Chrome preferences appeared in many different folder rules. I don't know if it's relevant, but most of the folders I'm tracking are synced on iCloud.

2024-03-13 09:59:07.008 86Z3GCJ4MF.com.noodlesoft.HazelHelper[88795] DEBUG: Error reading xattr com.noodlesoft.Hazel.LastUninstallLogCheckDate from file /Users/Shared/Hazel/Uninstall Log: No such file or directory
2024-03-13 09:59:07.008 86Z3GCJ4MF.com.noodlesoft.HazelHelper[88795] Error while checking uninstall log date: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"
2024-03-13 09:59:07.008 86Z3GCJ4MF.com.noodlesoft.HazelHelper[88795] DEBUG: Uninstall log does not exist.

2024-03-13 09:59:07.328 hazelworker[88800] DEBUG: Pausing to wait for things to settle down.
2024-03-13 09:59:07.356 hazelworker[88803] DEBUG: Error reading file /Users/**/Library/Application Support/Firefox/prefs.js: Error Domain=NSCocoaErrorDomain Code=260 "The file “prefs.js” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/**/Library/Application Support/Firefox/prefs.js, NSUnderlyingError=0x600001b28a80 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
2024-03-13 09:59:07.374 hazelworker[88803] DEBUG: Could not find entry for default_directory in Chrome preference file.
2024-03-13 09:59:07.377 hazelworker[88803] DEBUG: Could not read Mail preferences.

2024-03-13 09:59:08.414 86Z3GCJ4MF.com.noodlesoft.HazelHelper[88795] DEBUG: Checking events for path /Users/**/.Trash, folder Trash
2024-03-13 09:59:08.414 hazelworker[88800] DEBUG: About to process directory /Users/**/.Trash
2024-03-13 09:59:08.422 hazelworker[88800] Received error while processing file /Users/**/.Trash: Error Domain=NSCocoaErrorDomain Code=257 "The file “Trash” couldn’t be opened because you don’t have permission to view it." UserInfo={NSURL=file:///Users/**/.Trash, NSFilePath=/Users/**/.Trash, NSUnderlyingError=0x600000485f80 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
macrospecter
 
Posts: 6
Joined: Sat Mar 09, 2024 5:53 pm

This seems unrelated to your reported problem but it does look like you have not enabled full disk access for Hazel. Go to System Settings->Privacy & Security->Full Disk Access and enable it there. Reboot just to make sure the changes take effect.

As for the logs, search for a file that Hazel isn't processing correctly.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Some updates:
1. I have now granted full disk access to Hazel. However, that access is grayed out in the "Files and Folders" privacy area, if that is relevant (it is grayed out for all other apps that have it, too). In the "Full Disk Access" section, the green check box is checked.
2. I believe the problem is isolated to Downloads, or to folders that are not synced to the cloud. Hazel has access to "iCloud" under "Files and Folders," but not to other folders (and I don't see any way to add specific folders). I ran a test and my rules applied to every folder that is synced to iCloud, as well as to SOME of my files in the Applications folder (oddly many of the native applications on my Mac, and Google Chrome, and a few other, seem to have been skipped over by the test).
3. The option "run rules now" for Downloads is grayed out for hours at a time, basically always unless I quit Hazel or restart my computer... Even though I don't see any activity in that folder under the logs. I tried removing the folder and re-adding it, but the same things is happening.
4. I have searched the logs and they don't show anything helpful that I can tell. The Downloads folder, for instance, just shows that a "worker" was assigned to the folder and nothing else, no activity. Here are the logs for Downloads most recently:

2024-03-14 08:59:42.441 86Z3GCJ4MF.com.noodlesoft.HazelHelper[99678] DEBUG: Deploy folders: (
Applications,
Attachments,
Desktop,
Obsidian,
"Teaching"
)
2024-03-14 08:59:42.441 86Z3GCJ4MF.com.noodlesoft.HazelHelper[99678] DEBUG: Thread 0x600002cbc540: Deploying worker for folder: /Applications
2024-03-14 08:59:42.441 86Z3GCJ4MF.com.noodlesoft.HazelHelper[99678] DEBUG: Thread 0x600002cbc540: Deploying worker for folder: /Users/**/Library/Mobile Documents/iCloud~com~hahainteractive~GoodTask3/Documents/Attachments
2024-03-14 08:59:42.441 86Z3GCJ4MF.com.noodlesoft.HazelHelper[99678] DEBUG: Thread 0x600002cbc540: Deploying worker for folder: /Users/**/Desktop
2024-03-14 08:59:42.441 86Z3GCJ4MF.com.noodlesoft.HazelHelper[99678] DEBUG: Thread 0x600002cbc540: Deploying worker for folder: /Users/**/Library/Mobile Documents/iCloud~md~obsidian/Documents/Obsidian Vault/**
2024-03-14 08:59:42.441 86Z3GCJ4MF.com.noodlesoft.HazelHelper[99678] DEBUG: Thread 0x600002cbc540: Deploying worker for folder: /Users/**/Library/Mobile Documents/iCloud~md~obsidian/Documents/Obsidian Vault/**
2024-03-14 08:59:42.441 86Z3GCJ4MF.com.noodlesoft.HazelHelper[99678] DEBUG: Thread 0x600002cbc540: Deploying worker for folder: /Users/**/Library/Mobile Documents/iCloud~md~obsidian/Documents
2024-03-14 08:59:42.441 86Z3GCJ4MF.com.noodlesoft.HazelHelper[99678] DEBUG: Thread 0x600002cbc540: Deploying worker for folder: /Users/**/Documents/**/Teaching
2024-03-14 08:59:42.441 86Z3GCJ4MF.com.noodlesoft.HazelHelper[99678] DEBUG: Thread 0x600002cbc540: Deploying worker for folder: /Users/**/Documents/**/Teaching/**
2024-03-14 08:59:42.441 86Z3GCJ4MF.com.noodlesoft.HazelHelper[99678] DEBUG: Thread 0x600002cbc540: Undeploying worker for folder: /Users/**/Downloads
2024-03-14 08:59:42.444 86Z3GCJ4MF.com.noodlesoft.HazelHelper[99678] DEBUG: Thread 0x600002cbc540: FOLDERS SYNCED: (
Desktop,
"Teaching",
Applications,
Obsidian,
Attachments,
macrospecter
 
Posts: 6
Joined: Sat Mar 09, 2024 5:53 pm

See if you can find the worker processing downloads in that log. There should be a number in square brackets (like "[99678]" for the HazelHelper messages). Find that and enter that into the search field. That should filter out the messages for that worker.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Unfortunately, it looks like the number in square brackets repeatedly changes, and there are thousands of entries for each one. However, here are some new things I discovered about Downloads from the recent logs (some possible errors in bold):

2024-03-13 17:09:21.968 86Z3GCJ4MF.com.noodlesoft.HazelHelper[98694] DEBUG: Thread 0x60000297c500: Deploying worker for folder: /Users/macro/Downloads
Downloads,
2024-03-13 17:09:22.015 86Z3GCJ4MF.com.noodlesoft.HazelHelper[98694] DEBUG: Scheduling path: /Users/macro/Downloads for folder: Downloads
2024-03-13 17:09:22.015 86Z3GCJ4MF.com.noodlesoft.HazelHelper[98694] DEBUG: Thread 0x60000297c500: Run worker for folder: /Users/macro/Downloads
2024-03-13 17:09:52.259 86Z3GCJ4MF.com.noodlesoft.HazelHelper[98694] DEBUG: Thread 0x60000297c500: Timer fired for folder: /Users/macro/Downloads
2024-03-13 17:09:52.259 86Z3GCJ4MF.com.noodlesoft.HazelHelper[98694] DEBUG: Thread 0x60000297c500: Run worker for folder: /Users/macro/Downloads
2024-03-13 17:31:46.740 86Z3GCJ4MF.com.noodlesoft.HazelHelper[98694] DEBUG: Thread 0x60000297c500: Run worker for folder: /Users/macro/Downloads
2024-03-13 17:36:24.146 86Z3GCJ4MF.com.noodlesoft.HazelHelper[98694] DEBUG: Thread 0x60000297c500: Undeploying worker for folder: /Users/macro/Downloads
Downloads,


2024-03-13 17:36:47.278 86Z3GCJ4MF.com.noodlesoft.HazelHelper[99634] DEBUG: Warning: attempted to schedule paused folder: Downloads
2024-03-13 17:36:53.666 86Z3GCJ4MF.com.noodlesoft.HazelHelper[99634] DEBUG: Thread 0x6000028406c0: Run worker for folder: /Users/macro/Downloads
Downloads,


2024-03-14 08:57:54.182 86Z3GCJ4MF.com.noodlesoft.HazelHelper[99678] DEBUG: Thread 0x600002cbc540: Timer fired for folder: /Users/macro/Downloads
2024-03-14 08:57:54.183 86Z3GCJ4MF.com.noodlesoft.HazelHelper[99678] DEBUG: Thread 0x600002cbc540: Run worker for folder: /Users/macro/Downloads
2024-03-14 08:59:42.441 86Z3GCJ4MF.com.noodlesoft.HazelHelper[99678] DEBUG: Thread 0x600002cbc540: Undeploying worker for folder: /Users/macro/Downloads

2024-03-14 18:04:58.030 86Z3GCJ4MF.com.noodlesoft.HazelHelper[19057] DEBUG: Error resolving symlinks for path /Users/macro/Downloads/.com.google.Chrome.haw3LF:, No such file or directory
2024-03-14 18:04:58.030 86Z3GCJ4MF.com.noodlesoft.HazelHelper[19057] DEBUG: Thread 0x600002550100: Run worker for folder: /Users/macro/Downloads
2024-03-15 06:24:46.619 86Z3GCJ4MF.com.noodlesoft.HazelHelper[19057] DEBUG: Thread 0x600002550100: Timer fired for folder: /Users/macro/Downloads
2024-03-15 06:24:46.620 86Z3GCJ4MF.com.noodlesoft.HazelHelper[19057] DEBUG: Thread 0x600002550100: Run worker for folder: /Users/macro/Downloads
path = "/Users/macro/Downloads/.com.google.Chrome.uler55";
) for stream at path: /Users/macro/Downloads
2024-03-15 09:28:22.798 86Z3GCJ4MF.com.noodlesoft.HazelHelper[19057] DEBUG: Thread 0x600002550100: Run worker for folder: /Users/macro/Downloads
path = "/Users/macro/Downloads/.com.google.Chrome.uler55";
) for stream at path: /Users/macro/Downloads
2024-03-15 09:28:23.535 86Z3GCJ4MF.com.noodlesoft.HazelHelper[19057] DEBUG: Thread 0x600002550100: Run worker for folder: /Users/macro/Downloads
path = "/Users/macro/Downloads/.com.google.Chrome.uler55";
path = "/Users/macro/Downloads/Philosophy of Communication and Information.pdf.crdownload";
path = "/Users/macro/Downloads/Philosophy of Communication and Information.pdf.crdownload";
path = "/Users/macro/Downloads/Philosophy of Communication and Information.pdf";
path = "/Users/macro/Downloads/Philosophy of Communication and Information.pdf";
) for stream at path: /Users/macro/Downloads
**2024-03-15 09:28:43.444 86Z3GCJ4MF.com.noodlesoft.HazelHelper[19057] DEBUG: Error resolving symlinks for path /Users/macro/Downloads/.com.google.Chrome.uler55:, No such file or directory**
2024-03-15 09:28:43.444 86Z3GCJ4MF.com.noodlesoft.HazelHelper[19057] DEBUG: Error resolving symlinks for path /Users/macro/Downloads/Philosophy of Communication and Information.pdf.crdownload:, No such file or directory
2024-03-15 09:28:43.444 86Z3GCJ4MF.com.noodlesoft.HazelHelper[19057] DEBUG: Error resolving symlinks for path /Users/macro/Downloads/Philosophy of Communication and Information.pdf.crdownload:, No such file or directory
2024-03-15 09:28:43.444 86Z3GCJ4MF.com.noodlesoft.HazelHelper[19057] DEBUG: Thread 0x600002550100: Run worker for folder: /Users/macro/Downloads
path = "/Users/macro/Downloads/Philosophy of Communication and Information.pdf";
) for stream at path: /Users/macro/Downloads
2024-03-15 09:28:44.633 86Z3GCJ4MF.com.noodlesoft.HazelHelper[19057] DEBUG: Thread 0x600002550100: Run worker for folder: /Users/macro/Downloads
path = "/Users/macro/Downloads/Philosophy of Communication and Information.pdf";
path = "/Users/macro/Downloads/Stegmann U_PhilComm_.pdf";
) for stream at path: /Users/macro/Downloads
2024-03-15 09:28:57.814 86Z3GCJ4MF.com.noodlesoft.HazelHelper[19057] DEBUG: Error resolving symlinks for path /Users/macro/Downloads/Philosophy of Communication and Information.pdf:, No such file or directory
2024-03-15 09:28:57.815 86Z3GCJ4MF.com.noodlesoft.HazelHelper[19057] DEBUG: Thread 0x600002550100: Run worker for folder: /Users/macro/Downloads
path = "/Users/macro/Downloads/Stegmann U_PhilComm_.pdf";
) for stream at path: /Users/macro/Downloads
2024-03-15 09:28:58.815 86Z3GCJ4MF.com.noodlesoft.HazelHelper[19057] DEBUG: Thread 0x600002550100: Run worker for folder: /Users/macro/Downloads
path = "/Users/macro/Downloads/Stegmann U_PhilComm_.pdf";
) for stream at path: /Users/macro/Downloads
2024-03-15 09:29:10.849 86Z3GCJ4MF.com.noodlesoft.HazelHelper[19057] DEBUG: Error resolving symlinks for path /Users/macro/Downloads/Stegmann U_PhilComm_.pdf:, No such file or directory
2024-03-15 09:29:10.849 86Z3GCJ4MF.com.noodlesoft.HazelHelper[19057] DEBUG: Thread 0x600002550100: Run worker for folder: /Users/macro/Downloads
macrospecter
 
Posts: 6
Joined: Sat Mar 09, 2024 5:53 pm

Try the following for the Downloads folder:

- Export your rules
- Remove the folder from Hazel.
- Add the folder back into Hazel
- Import your rules and re-enable as necessary.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thank you. Somehow, mysteriously, after a restart these rules started working!
macrospecter
 
Posts: 6
Joined: Sat Mar 09, 2024 5:53 pm

Mr_Noodle wrote:Try the following for the Downloads folder:

- Export your rules
- Remove the folder from Hazel.
- Add the folder back into Hazel
- Import your rules and re-enable as necessary.


I just had the same problem (after reinstalling my system from a backup). Exporting/importing rules didn't change anything.

In the end it turned out that I had to also grant Full Disk Access to the Hazel helper. Not sure how to upload screenshots here; the name is something like 86Z3GCJ4M...ft.HazelHelper. The entry already existed in the list, but was unchecked.
jandubois
 
Posts: 1
Joined: Sun Mar 12, 2017 2:56 pm


Return to Support