Open file in a specific application.

Example scripts and tips (replaces Old Scripts & Tips archive)

Moderators: Dorian (MJT support), JRL, Phil Pendlebury

Post Reply
User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Open file in a specific application.

Post by Dorian (MJT support) » Fri Jan 13, 2017 9:19 pm

Sometimes, I need to open a file using an application that is not set as default for that filetype.

Of course, if you want to open a file using the default application, you'd simply use ExecuteFile.

The following snippet allows me to control which application I want my file to open in. In this case, I'm making it open in MS Paint, using RunProgram.

RunProgram>msPaint.exe %FileName%
  View Snippet Page

E.G.
RunProgram>msPaint.exe c:\filename.bmp
Yes, we have a Custom Scripting Service. Message me or go here

User avatar
Meryl
Staff
Posts: 124
Joined: Wed Sep 19, 2012 1:53 pm
Location: Texas
Contact:

Re: Open file in a specific application.

Post by Meryl » Mon Jan 16, 2017 2:40 pm

Thanks for sharing all your tips, Dorian! Appreciate you!

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Open file in a specific application.

Post by Dorian (MJT support) » Mon Jan 23, 2017 7:43 pm

Thanks Meryl.

In my 18 years or so of using Macro Scheduler, I've learned that little tips like this can make a world of difference.
Yes, we have a Custom Scripting Service. Message me or go here

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts