Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

OnScriptMenu: the index 'GetFileName' does not exist

(1/1)

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


--- Code: ---        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);
--- End code ---

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:
Scripts are case-sensitive:

--- Code: ---wxString GetFilename
--- End code ---

Anbang24:
Thanks!

Navigation

[0] Message Index

Go to full version