Guides/Auto Open

From J Wiki
Jump to: navigation, search

This page describes how to configure Windows so that right-clicking a J script file (*.ijs) in Windows Explorer will give you the following options:

  • Open : starts j.exe, creates a new ijx session and opens the script file
  • load  : starts j.exe, creates a new ijx session and loads the script file in it
  • run   : starts j.exe and loads the script file without a session window

In addition, for Window 7 and Vista, the appropriate Registry entries are provided so that preview pane in Windows Explorer can display the contents of script files.

Instructions

Windows XP

If you have followed the Windows XP instructions for registering .ijs files, then all you need to do is add a couple of other actions to the J Script File file type.

Jao win.png

Different command line syntax options are as follows:

    • Start j.exe, create an ijx session and open the J Script File:

"C:\progra~1\j601\j.exe" -js "open '%1'"

    • Start j.exe, create an ijx session and load the J Script File:

"C:\progra~1\j601\j.exe" "%1"

    • Start j.exe and load the J Script File without a session window. A'la Auto Start:

"C:\progra~1\j601\j.exe" -jijx "%1"

The names you give the actions are a matter of personal preference. Ditto for which action you decide to make the default (i.e. the action that will be used when you double-click on the file).

Now when you right click on an .ijs file in Explorer, you should have the options to run, load or open it.

Windows 7 & Vista

Unfortunately Microsoft have removed the GUI method of associating custom actions with file types in Windows 7 and Vista, so to accomplish the same thing requires manipulating the Registry. You could do that manually or alternatively you can download and Merge the .reg file below into your Registry (right-click on the file in Windows Explorer and choose Merge).

Preview.png

In addition the last two paragraphs of the .reg file below enable the contents of .ijs scripts to be displayed in the Window 7/ Vista Explorer Preview Pane. This can be a very useful way of browsing the contents of scripts.

The .reg file below assumes that you have installed J.602 in C:\Program Files\ (a system install), if you have installed J to different location you will need to edit the paths in the registerIJSfiles.reg file to point to the location of your j.exe file before you Merge it to your Registry.

Obviously all the standard warnings about backing up your Registry etc beforehand probably apply here. Download script: registerIJSfiles.reg

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.ijs]
@="J_script_file"

[HKEY_CLASSES_ROOT\J_script_file]
@="J Script File"

[HKEY_CLASSES_ROOT\J_script_file\shell]

[HKEY_CLASSES_ROOT\J_script_file\shell\open]

[HKEY_CLASSES_ROOT\J_script_file\shell\open\command]
@="\"C:\\program files\\j602\\bin\\j.exe\" -js \"open '%1'\""

[HKEY_CLASSES_ROOT\J_script_file\shell\load]

[HKEY_CLASSES_ROOT\J_script_file\shell\load\command]
@="\"C:\\program files\\j602\\bin\\j.exe\" \"%1\""

[HKEY_CLASSES_ROOT\J_script_file\shell\run]

[HKEY_CLASSES_ROOT\J_script_file\shell\run\command]
@="\"C:\\program files\\j602\\bin\\j.exe\" -jijx \"%1\""

[HKEY_CLASSES_ROOT\J_script_file\ShellEx]

[HKEY_CLASSES_ROOT\J_script_file\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}]
@="{1531d583-8375-4d3f-b5fb-d23bbd169f22}"

Nota Bene

Each script you "open" will start a new copy of J.exe. If you are aware of a way to open several scripts using the same copy of J.exe, please add that information here.

See Also

  • The Guides/Auto Start page describes how to automatically run J scripts from your file or web browser.
  • The original forum thread that prompted this page
  • The forum post describing the preview pane support for .ijs files.
  • Article describing the method for adding preview support of other file types.