Author Topic: OnScriptMenu: the index 'GetFileName' does not exist  (Read 1390 times)

Offline Anbang24

  • Multiple posting newcomer
  • *
  • Posts: 14
OnScriptMenu: the index 'GetFileName' does not exist
« on: February 25, 2024, 08:59:25 am »
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);

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?




Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1591
Re: OnScriptMenu: the index 'GetFileName' does not exist
« Reply #1 on: February 25, 2024, 11:42:37 am »
Scripts are case-sensitive:
Code
wxString 	GetFilename

Offline Anbang24

  • Multiple posting newcomer
  • *
  • Posts: 14
Re: OnScriptMenu: the index 'GetFileName' does not exist
« Reply #2 on: February 26, 2024, 05:45:41 am »
Thanks!