How to know what the default FAYT filter is via scripting

@Leo I made a simple test script.

// FAYT_test

function OnInit(initData) {
	initData.name = "FAYT_test";
	initData.version = "1.0";
	initData.desc = "FAYT test to reproduce UpdateSuggestions issue";
	initData.default_enable = true;
	initData.min_version = "13.0";

}

// Called to add commands to Opus
function OnAddCommands(addCmdData) {
	var cmd = addCmdData.AddCommand();
	cmd.name = "fayt_test";
	cmd.method = "Onfayt_test";
	cmd.label = "fayt_test";
	cmd.hide = true; 
	var fayt = cmd.fayt;
	fayt.enable = true;
	fayt.key = '%';
	fayt.backcolor = '#ffad5b';
	fayt.textcolor = '#000000';
	fayt.label = "fayt_test";
	fayt.realtime = true;
}

// Implement the fayt_test command
function Onfayt_test(scriptFAYTData) {
	DOpus.Output('fayt : "' + scriptFAYTData.fayt + '"');
	if (scriptFAYTData.fayt != "fayt_test") return;
	DOpus.Output('cmdline : "' + scriptFAYTData.cmdline + '"');
	if (scriptFAYTData.suggest)
		scriptFAYTData.tab.UpdateFAYTSuggestions(DOpus.Create.Vector('abc', 'bcd', 'cde', 'def', 'efg', 'ghi', 'hij', 'ijk', 'jkl', 'klm', 'lmn'));
	return;
}

FAYT_test.opusscriptinstall (877 Bytes)

By default, you can call it with %.
Using it as non default mode, you can type a for example, and get a suggestion.
In order to reproduce the issue, please:

  1. Set the script as the default filter.
  2. Call the script via its quick key. (e.g. %a).
  3. Try to get some suggestions. You shouldn't be able to see any.

Seems that when using tab.UpdateFAYTSuggestions, DO is using the complete text introduced in the FAYT bar, % included, to ask for suggestions. Since scriptFAYTData.cmdline ignores the first character if it is the configured quick key (even if the script is the default filter), make DO acts the same when asking for suggestions would be ideal.

Thanks for taking the time to check this!