ShellExecute

Started by Carlo Didier, June 12, 2017, 11:08:56 PM

Previous topic - Next topic

Carlo Didier

I had already made a new script to open Bridge with the currently seleted file, but I have some questions about it.
It is derived from the Geosetter script:

            IMatch.modalClose();
           
            var pathToBridge = 'C:\\Program files\\Adobe\\Adobe Bridge CC 2017\\Bridge.exe';
            $(document).ready(function () {
IMWS.get('v1/files',{
// This idlist represents all files currently selected in the active file window.
idlist: IMatch.idlist.fileWindowFocusedFile,
// we only need the full file name of the first file
fields: 'filename'
}).then(function(response) {
var pathToFolder = response.files[0].fileName;
console.log(response.files[0].fileName);
IMatch.shellExecute({
'executable' : '\"' + pathToBridge + '\"',
'verb' : 'open',
'parameters' : '\"' + pathToFolder + '\"',
'showwindow' : false
});
                });
            });
        </script>


I had hoped that "'showwindow' : false" would mean that no app panel is opened, but that doesn't work. Is there another way either to immediately close the panel again or not to open it in the first place?
What does the "showwindow" parameter do?

Another question: where in the new documentation can I find all the references to iMatch objects. In the above script, I'd like to pass the folder to Bridge instead of the path including the file name, but I can't find anything in the new doc. Would that be "FilePath" or ParentFolder" or what (instead of "FileName")?

Mario

#1
1. showwindow is a parameter that tells Windows to not open a window for the process you start. It has nothing to do with IMatch app panels. You cannot close an app panel from inside a script. You can close a modal app using IMatch.modalClose.

The documentation for IMatch.shellExecute is here: https://www.photools.com/dev-center/doc/imatch/IMatch.html

The documentation from Microsoft for ShellExecute is here: https://msdn.microsoft.com/en-us/library/windows/desktop/bb762153(v=vs.85).aspx

The documentation of IMWS is in the IMWS Doc App.
Unfortunately, it is broken in the latest shipment (see https://www.photools.com/community/index.php?topic=6712.msg1;topicseen#new for the fix).
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook