Jump to content

How to open multiple files in only one instance of the corresponding program?


Recommended Posts

Hi friends,

Suppose MyProgram is a tabbed program, meaning that it allows for opening multiple files in the same instance.

I want to open File1, File2 and File3 in one instance of MyProgram from an AutoIT script. How can I do this?

I have read the AutoIT Help File about "ShellExecute" and "Run", but I have found nothing helpful.

Thanks for reading my question. Any answer would be very appreciated.

 

 

Link to comment
Share on other sites

This thread has some approaches you can see using AutoIt.

 

Generally the pattern sounds like the tabbed application that would display a file per tab would be considered the Primary Instance of the application.  Other copies of the program that just pass the command line on to the Primary are considered Secondary instances.  They pass on the command line params, then exit.

 

The are many forms of Interprocess Communication or IPC that can be used on Windows.  The thread I linked has some done in AutoIt.  But you could roll your own using Windows API calls via the DllCall function.

 

Link to comment
Share on other sites

Hi Kylomas, pls see MilesAhead's post to understand my question more clearly. Thank you.

Hi MilesAhead, thank you for your answer. This seems to be complicated if we use just AutoIT to accomplish this task. I decided to combine AutoIT and a Windows batch file to achieve the same task, but with a simpler programming skill required.

Edited by bobbyab9987
Link to comment
Share on other sites

How are you getting your list of files?

How are you opening the files? Command-line or browsing etc.

If browsing, then look at the options for FileOpenDialog command in the 4th (Options) parameter - Multiselect.

Command-line is possibly even simpler, providing you supply all the elements correctly (quotes etc).

Other than that, I suggest you search for exactly what you want or provide some basic code that we can work with, especially so that we can get a clearer understanding of what you need.

It shouldn't be that complicated, providing you understand a few basics. In fact, it seems to me that adding a batch file is only adding complexity ... but then I'm not entirely sure of what you are wanting to do.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...