<pre>function getCurrentModule  repeat with x = 1 to the number of menuItems of menu "Modules"    if checkMark of menuItem x of menu "Modules" then return x  end repeat  return 0end getCurrentModule</pre>