In this article we present the definition of the generalized maximal operator \(M_\Phi\) acting on measures and we prove some of its basic properties. More precisely, we demonstrate that \(M_\Phi\) satisfies a Kolmogorov inequality and that this operator is of weak type \((1,1)\) . This allow us to obtain a family of \(A_p\) weights involving the distance \(d(x,F)\) to a closed set \(F\) in a framework of Ahlfors spaces. Also, we prove that \(M_\Phi\) satisfies a weighted modular weak type inequality associated to the Young function \(\Phi\) , and we give another one that yields a sufficient condition for the weight to belong to the \(A_1\) class.