Rules that operate on selected wifi network

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

Moderators: Mr_Noodle, Moderators

Is it possible to run a rule only if my Macbook Air is connected to certain wifi network?

Hence, moving movies I have downloaded from my iPhone to my network attached disk on my Airport Extreme Base Station and then deleting them to save room?
acuriouslad
 
Posts: 5
Joined: Fri Jan 25, 2013 12:49 am

You'll have to use a custom script for that or if you just setup a rule to copy to an unavailable drive, Hazel will run the rule when you connect the drive later. I have thought about adding an attribute like "Network location" where you can configure things to be based off of wi-fi network if you wish but I'm still ascertaining whether it's really needed given that Hazel should handle off-line drives.
Mr_Noodle
Site Admin
 
Posts: 11235
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thanks Mr Noodle!

Will Hazel give me errors every time it tries to run and the drive isn't found?
acuriouslad
 
Posts: 5
Joined: Fri Jan 25, 2013 12:49 am

Whoops, I just noticed that this was posted in the wrong forum. In the future, please keep questions out of the Tips forum. That is for people posting tips, not asking for them.
Mr_Noodle
Site Admin
 
Posts: 11235
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

I'd like to re-ask the question above?

How does Hazel handle drives that are unavailable? Does it just log an error and move on? What is the interval that it checks? This is important to know so I know how quickly it will start processing once the drive is available again, as well as how much processing is happening by feeble attempts to connect when it's not available.
chambrick
 
Posts: 15
Joined: Thu May 15, 2014 4:38 pm

There are various factors, but in the best case, it won't do much processing at all when it detects it is offline. Worst case, it will use a back-off strategy where the check times become larger and larger. When a drive is mounted, it will detect it fairly quickly since there is a system notification for that.
Mr_Noodle
Site Admin
 
Posts: 11235
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

You can try using the free ControlPlane app: http://www.controlplaneapp.com

It figures out your location based on rules you specify (which wifi you are connected to, what disks are mounted, etc.) Based on your location you can automatically perform actions (mount drives, change default printer, run shell scripts, etc.)

My MacBook Air automatically makes adjustments based on whether I'm at work or home. I'm sure you can find a way of using that to trigger something in Hazel. You could have it create a file that Hazel is looking for which triggers other actions or something like that. It's similar to Hazel in that it's very, very flexible.
ManhattanBeachBum
 
Posts: 3
Joined: Tue Aug 19, 2014 11:46 pm

Re: Rules that operate on selected wifi network Sat Dec 24, 2016 12:57 pm • by Zigzagi
Mr_Noodle wrote:You'll have to use a custom script for that or if you just setup a rule to copy to an unavailable drive, Hazel will run the rule when you connect the drive later. I have thought about adding an attribute like "Network location" where you can configure things to be based off of wi-fi network if you wish but I'm still ascertaining whether it's really needed given that Hazel should handle off-line drives.


I think it is important that network name attributes are allowed. That way, it will make creating rules more flexible for non-programmers.
I have a rule to move files to my network drive once my mac is connected to the particular wifi network.

When I am not connected to the particular network, Hazel runs but gives errors. I will prefer it to not run until my mac is connected to the particular network.
Zigzagi
 
Posts: 5
Joined: Sat Dec 24, 2016 12:51 pm


Return to Open Discussion

cron