Planning observation: determine dates where moon is within 30 degrees of my object? I'm planning an observation for a proposal and I need to determine which dates the moon is within 30 degrees of an object so I can ask to not be scheduled for those dates.  This object is near the ecliptic so it is guaranteed the moon will pass close by at times.

In the past I've used skycalc to manually figure out such dates, but now I need to figure out dates over a several month period, and I was hoping there was some more automated tool I could use for this purpose.
I would use JPL Horizons to calculate the position of the Moon and save the results to a text file. Then use a spreadsheet to calculate the separation between the Moon and your object. $$\cos \theta = \sin \delta_1 \sin \delta_2 + \cos \delta_1 \cos \delta_2 \cos (\alpha_1 - \alpha_2)$$ where $\theta$ is the separation, $\delta$ is the declination, and $\alpha$ is the right ascension.

Since the Moon moves about 1 degree in 2 hours, you can use that to determine what time interval to use in the output, depending on how accurately you want to find the 30 degree separation.