Get the current cue number of selected sequence

  • Hi Guys,

    I'm trying to get the current cue number of the selected sequence.
    Something like $SELECTEDEXECCUE in GMA2.

    I figured it out using following LUA script:

    local function main()
        local selectedSeq = SelectedSequence()
        local cue = selectedSeq:CurrentChild()
        local currentcue = cue.index
        SetVar(UserVars(),"selectedexeccue", currentcue)
    return main

    It does returns the number of the current cue, but this doesn't work with cue numbers like 1.2 - 4.5 - 8.9 - ...

    In this example it returns cue numbers like 1 - 4 - 8 - ....

    How can I make this work, and also returns cue numbers after comma?

    Kind regards,


  • Borrowing this thread for a bit.

    Tried to use this LUA scirpt for my self but hit a little wall and my understandin is not sufficient to go forward.


    Run script



    Illegal object:Fixture 3.000000

    So no if I write to commandline:

    Cue $selectedexeccue

    I get illegal Cue number in return.

    Can somebody enlighten me what I am doing wrong so I might learn something new. Thanks in advance.

  • cue-numbers are nether integers nor decimal numbers, as cue-numbers are limited to 3 digits after the dot.

    this is a number format not supported by $variables

    you could workaround this by converting the cue-number to a string before setting the $variable

    local currentcue = tostring(cue.No/1000)


    local currentcue = 'Cue ' .. cue.No/1000

  • Many thanks for the fast response. Now I can go to sleep.

    Really need to start learning Lua properly, it just seems like bottomless well atm. But still this is why I love MA3 there is so many different learning opperturnities with this software that I have just scratched the surface!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!