Open script in editor

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

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

Post Reply
kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Open script in editor

Post by kpassaur » Thu May 07, 2020 2:48 pm

In the past I was able to right click on a script and then open it in the editor. I installed ver 15 and it runs the script when I choose open with. I forgot how I changed it to open in the editor does anyone know. I searched the forum for +editor +open +right +click but no luck

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

Re: Open script in editor

Post by Grovkillen » Thu May 07, 2020 7:11 pm

Try add "-EDITOR" after the path in the target setting of the shortcut:

from

Code: Select all

"C:\Program Files (x86)\Macro Scheduler 15\msched.exe"
to

Code: Select all

"C:\Program Files (x86)\Macro Scheduler 15\msched.exe" -EDITOR
I guess the same goes for the standard application settings?
Let>ME=%Script%

Running: 15.0.24
version history

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Re: Open script in editor

Post by kpassaur » Thu May 07, 2020 7:15 pm

I already do that. I am trying to make it so I right click on a script and from the drop down I select "Open With" and have it open in the editor. Currently it runs it, before I updated to ver 15 I could do it.

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

Re: Open script in editor

Post by Grovkillen » Thu May 07, 2020 7:23 pm

Regedit:

Code: Select all

HKEY_CLASSES_ROOT\msched\shell\open\command
from:

Code: Select all

"C:\Program Files (x86)\Macro Scheduler 15\msched.exe" "%1"
to:

Code: Select all

"C:\Program Files (x86)\Macro Scheduler 15\msched.exe" "%1" "-EDITOR"
Double click on a macro file (.scp) will now open it in the editor instead of running it.

EDIT: it just opens the editor, not with the script... sorry.

EDIT2: this should work:

Code: Select all

"C:\Program Files (x86)\Macro Scheduler 15\msched.exe" "-EDITOR" "%1"
Last edited by Grovkillen on Thu May 07, 2020 7:29 pm, edited 2 times in total.
Let>ME=%Script%

Running: 15.0.24
version history

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

Re: Open script in editor

Post by Grovkillen » Thu May 07, 2020 7:24 pm

And right click and choose "edit" instead of "open" will already do what you want...?
Let>ME=%Script%

Running: 15.0.24
version history

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

Re: Open script in editor

Post by Grovkillen » Thu May 07, 2020 7:31 pm

PS. and thanks for asking because I now have put this as my default action when clicking a script :) Never got around to do it until you reminded me.
Let>ME=%Script%

Running: 15.0.24
version history

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Re: Open script in editor

Post by kpassaur » Thu May 07, 2020 7:38 pm

Many thanks, now it opens in the editor just the way I wanted.

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

Re: Open script in editor

Post by Grovkillen » Tue Apr 20, 2021 10:09 am

The regex hack is being reset when I update MS. Could this be made into an option?
Let>ME=%Script%

Running: 15.0.24
version history

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

Re: Open script in editor

Post by Grovkillen » Tue Apr 20, 2021 10:21 am

I have now found out that the "(Standard)" value is read/written with the key set to "":

Code: Select all

RegistryReadKey>HKEY_CLASSES_ROOT,msched\shell\open\command,,CURRENT_KEY_VALUE
Should perhaps be added to the help documentation?
Let>ME=%Script%

Running: 15.0.24
version history

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

Re: Open script in editor

Post by Grovkillen » Wed Sep 29, 2021 7:09 am

Grovkillen wrote:
Tue Apr 20, 2021 10:21 am
I have now found out that the "(Standard)" value is read/written with the key set to "":

Code: Select all

RegistryReadKey>HKEY_CLASSES_ROOT,msched\shell\open\command,,CURRENT_KEY_VALUE
Should perhaps be added to the help documentation?
Grovkillen wrote:
Tue Apr 20, 2021 10:09 am
The regex hack is being reset when I update MS. Could this be made into an option?
Any input on this?
Let>ME=%Script%

Running: 15.0.24
version history

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