Opening a file

Talk, speculate, discuss, pontificate. As long as it pertains to Hazel.

Moderators: Mr_Noodle, Moderators

Opening a file Fri Dec 23, 2022 7:31 pm • by hexadecagram
I am trying to whip up a rule that will automatically run BusyCal (my preferred and default calendar app) to import an .ics file when it ends up in ~/Downloads.

I have tried using the "Open" action both with either "Default Application" or BusyCal configured, and with or without "Bring to front" enabled. No combination brings up the import dialog. However, when I double-click in Finder or use the open command in Terminal, it does.

The action that follows (Move to Trash) does get executed. And if I configure "Bring to front" BusyCal is at least brought to the front.

If I remove the action to trash the file, I get the import dialog. So evidently it's getting trashed too quickly.

open takes a -W option, which will wait for BusyCal to exit. That may not work for me, because I tend to leave BusyCal running all the time. The other option is to use sleep, which could at least insert a delay before the file is trashed.

So a script might do the job but I'm wondering if this feature could be added to Hazel, if it isn't already there. It seems like it would be a pretty common issue to me.
hexadecagram
 
Posts: 5
Joined: Sun May 30, 2021 8:49 pm

Re: Opening a file Tue Dec 27, 2022 10:48 am • by Mr_Noodle
For now, you would need to use a script. The inclusion of a delay command of some sort is under consideration though I'd like to hear more use cases for it.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Open Discussion