News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

OnScriptMenu: the index 'GetFileName' does not exist

Started by Anbang24, February 25, 2024, 08:59:25 AM

Previous topic - Next topic

Anbang24

I write a piece of script to get the filename in the active editor as following:

        local edman = GetEditorManager();
        if (IsNull(edman))
       {
            ShowError(_("Could not query the Editor manager. Cannot continue."));
            return 0;
        }
        local editor = edman.GetActiveEditor();
        if (IsNull(editor)) 
       {
            ShowError(_("No active editor. Cannot continue."));
            return 0;
        }
        local fname = editor.GetFileName();  //??
        ShowInfo(fname);


It is very simple, however, I got the following message in running:
    OnScriptMenu:the index 'GetFileName' does not exist

I carefully read the Scripting commands (https://wiki.codeblocks.org/index.php/Scripting_commands),
but still don't understand why this happens. Does the command deprecated?




Miguel Gimenez