Skip to main content
August 4, 2009
Question

FM9: User menu/commands in session?

  • August 4, 2009
  • 1 reply
  • 749 views

Hi,

another difference in FM9/FDK9 with commands. We add our menu with Fx_ApiDefineCommand. When the menu command is clicked at logging we get the name of the command, but with FM9 it returns completely different labels and names. This is the function we use to get the names/labels of the command. It works for earlier versions. Any idea how to fix it?

StringT getCommandName(IntT cmdNum)

{

    F_ObjHandleT mcmdId = Fx_ApiGetId(0, FV_SessionId, FP_FirstCommandInSession);
    while (mcmdId) {
        IntT mcndNum = Fx_ApiGetInt(FV_SessionId, mcmdId, FP_CommandNum);
        if (mcndNum == cmdNum) {

            StringT name = Fx_ApiGetString(FV_SessionId, mcmdId, FP_Label);

          /*
            StringT fmName = Fx_ApiGetString(FV_SessionId, mcmdId, FP_Name);
            F_Free(fmName);

          */

            return name;

            F_Free(name);

        }
        mcmdId = Fx_ApiGetId(FV_SessionId, mcmdId, FP_NextCommandInSession);
    }

}

UPDATE: if you place a breakpoint after getting the label, and not returning but setting the next statement to  FP_NextCommandInSession line, you are able to get the correct label. It seems there are more commands with the same cmdId that are in the session.

just wondering how many things could be changed the similar way

Thanks,

Viktor

    This topic has been closed for replies.

    1 reply

    Legend
    August 4, 2009

    Hi Viktor,

    There have always been multiple internal commands assigned to the same command numbers. I am able to confirm that there have been changes with FM9, in particular with the addition of commands and changed Alt-key shortcut locations (the & in a name). Like your previous post about notifications, though, I don't think there is anything you can do about it. When Adobe updates this software, I'm sure it is far too much of a burden to maintain backward compatibility with these small details, especially given the huge list of commands that FM has.

    I'm curious, though... are you talking about commands that you define with your API client?  I didn't notice any difference there with my commands, except of course that there may be new internal commands that now share the same number. It looks like all numbered commands are in the 100's or less... if you are concerned about conflicts with your commands, perhaps you could start using numbers much higher with your commands to distinguish them.

    Russ

    August 6, 2009

    Hi Russ,

    yes, I was talking about commands that I define. The function I mentioned now returns FM (not before) and user defined commands with many duplicates even numbered over 1000.

    "I'm curious, though... are you talking about commands that you define with your API client?  I didn't notice any difference there with my commands, except of course that there may be new internal commands that now share the same number. It looks like all numbered commands are in the 100's or less... if you are concerned about conflicts with your commands, perhaps you could start using numbers much higher with your commands to distinguish them."

    Viktor

    Legend
    August 6, 2009

    So, help me understand... if these are your commands, why don't you already know when they are executed? Maybe there is a workaround to this, but I'm not quite clear on what you need this function for.

    Russ