Trying IMatch.commandExecute without success.

Started by ubacher, July 03, 2017, 06:33:21 PM

Previous topic - Next topic

ubacher

I tried the following today
IMatch.focusWindow('mediafolders.tree');
IMatch.commandExecute('ID_CMD_FOLDER_SCANFOLDER');


and I was expecting the current folder to be rescanned. Did not - what's wrong?
and i tried
            IMatch.focusWindow('filewindow.active')
            IMatch.commandExecute('ID_FILTERPANEL_CLEAR');

Expecting the filter to be turned off. Did not work either.


Mario

Not all commands work in all contents.
And keep in mind that these are asynchronous. Did you wait for focusWindow to complete (then logic) before you called the next command?

Selecting a folder (focusing the M&F tree) may take several seconds, depending on the current context, the number of files in the selected folder, the location of the folder (local, remote), the selected file window layout, the selected sort profile.

I would generally not rely on these functions. They have been added for very specific purposes and proper handling by the programmer is assumed.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

I got the following to work:
IMatch.focusWindow('mediafolders.tree').then(function (response) {
                console.log(JSON.stringify(response));
                IMatch.commandExecute('ID_CMD_FOLDER_SCANFOLDER');
                IMatch.modalClose()
            })

It rescans the current folder.

but I have no luck attempting to turn the filter on/off. Tried various commands.
IMatch.focusWindow('filewindow.active').then(function (response) {
                console.log('response'+JSON.stringify(response));
                IMatch.commandExecute('ID_FILTERPANEL_APPLY');
            })

tried ID_FILTERPANEL_ENABLE, ID_FILTERPANEL_CLEAR without luck.

I tried various other commands to make sure my code works. The following worked:
ID_VIEW_SHOW_FILEWNDCONTAINER_FILTER, ID_WINDOW_SWITCH_CAT, ID_VIEW_SHOW_FAVORITES

What command will let me turn filtering on/off?

Mario

Not all commands work  in all context. This endpoint is mostly for me. You can use it in your apps when it works, but when it does fail, I will not spend time investigating.
The filter panel is way to complex in its interactions., You can easily create your own filters in your app and use the corresponding endpoints to filter the file window contents. No need to remote control the filter panel.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

The problem I am trying to solve by turning off the filtering is as follows:

I can create a set of files with a script but can not display all the files in a result window if filtering is on and
thus some files filtered out. Already mentioned this previously ( in a feature request I think)