Open Application With File

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
RNIB
Macro Veteran
Posts: 195
Joined: Thu Jan 10, 2008 10:25 am
Location: London, UK

Open Application With File

Post by RNIB » Thu Aug 29, 2024 9:04 am

I need to open a file in a particular application. If you launch the application first and go to File>Open, there isn't a field where you can add the path to the file. Instead you a tree view which you have to scroll through with your mouse to locate the file.

To get around this I thought I could launch the application with the file by using:

RunProgram>C:\Program Files (x86)\Dolphin\Publisher353\Publisher.exe %str_root_folder%\ncc.html

Unfortunately when I do this, Publisher gives me a message saying that it cannot open it as one or more of the files are Read Only. None of them are Read Only. If I launch Publisher and then open the file manually, it opens perfectly.

Is there another way I can open a file with a specific application?

User avatar
Grovkillen
Automation Wizard
Posts: 1131
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Open Application With File

Post by Grovkillen » Thu Aug 29, 2024 10:33 am

Tested this?

Code: Select all

RunProgram>"C:\Program Files (x86)\Dolphin\Publisher353\Publisher.exe" "%str_root_folder%\ncc.html"
Let>ME=%Script%

Running: 15.0.27
version history

RNIB
Macro Veteran
Posts: 195
Joined: Thu Jan 10, 2008 10:25 am
Location: London, UK

Re: Open Application With File

Post by RNIB » Thu Aug 29, 2024 10:53 am

Unfortunately that produces the same 'read only' message.

I can work around it by setting Publisher as the default application for .html files and then use the ExecuteFile command but I'd rather not change the default application as this will be a macro run on multiple different PC's where doing this wouldn't be ideal.

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Open Application With File

Post by JRL » Thu Aug 29, 2024 2:15 pm

What happens if you rename the file by slapping a .PUB on the end of it then run ExecuteFile> :?:

RNIB
Macro Veteran
Posts: 195
Joined: Thu Jan 10, 2008 10:25 am
Location: London, UK

Re: Open Application With File

Post by RNIB » Mon Sep 02, 2024 1:55 pm

Unfortunately I can't do that as I have to keep the existing extension for the file to load correctly in the selected program.

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