Maya MEL script: Select every "N" edge loop/ring

Hello this MEL script selects every other "number" of edge loops or rings via a pop up.
Select your first edge loop or ring, execute the script and enter your value. You can then create a shelf button, add it to a hotkey or both.
Enjoy

_______________________

string $result = `promptDialog

    -title "Select Every N Edge Rings"

    -message "Every N rings:"

    -button "Select"

    -button "Cancel"

    -defaultButton "Select"

    -cancelButton "Cancel"

    -dismissString "Cancel"

    -text "3"

`;


if ($result == "Select")

{

    string $value = `promptDialog -query -text`;

    int $n = (int)$value;


    if ($n > 0)

    {

        polySelectEdgesEveryN "edgeRing" $n;

    }

    else

    {

        warning "Please enter a number greater than 0.";

    }

}