Open file in NEW instance?

English main discussion
Post Reply
  • Author
  • Message
Offline
Posts: 5
Joined: Mon Oct 26, 2009 6:52 pm

Open file in NEW instance?

Post by city_zen »

Hi,

I'm just starting to use AkelPad. From what I've discovered so far, it's a great little program :)
However, I'm missing an option (or maybe I haven't found out how to achieve it yet) for file management: how can I tell AkelPad to open files in NEW instances when I'm working in SDI mode? Whenever I try to open a file in AkelPad in SDI mode, AkelPad closes the current file I'm working on. I know this could be solved by using MDI mode, but I'm more comfortable with SDI mode.
So, is it possible? If it isn't possible (yet), could it be considered for future versions?

Thanks a lot

Offline
Posts: 147
Joined: Fri Feb 08, 2008 6:41 pm
Location: British Columbia, Canada

Post by Surveyor »

Welcome aboard!
city_zen wrote:how can I tell AkelPad to open files in NEW instances when I'm working in SDI mode?
Have a look at the options on the Options menu (SDI mode); if Don't open a file twice is checked, AkelPad opens the same file (even if it is changed!) in the same instance, closing the first. But if option is unchecked, opening the same file should open a new instance.

File/New window should always open a new instance also, although then you have to open the file manually (instead of just double clicking on the file to open AkelPad). Have a look at the User Manual for more info at:
http://akelpad.sourceforge.net/en/download.php

If you are a new user, then you might also want to take a look at the Plugins Manual at:
http://akelpad.sourceforge.net/en/plugins.php
Plugins provide many great features (Toolbar, Scripts, MinimizeToTray, etc.)!

Also, be aware that updating AkelPad is easier than it appears on the surface; check out the AkelUpdater utility here.

Personally, I rarely use SDI mode - I find multiple tabs in MDI mode easier to use. But that is just personal preference...

Offline
Posts: 5
Joined: Mon Oct 26, 2009 6:52 pm

Post by city_zen »

Surveyor wrote:Welcome aboard!
Thank you :D
city_zen wrote:how can I tell AkelPad to open files in NEW instances when I'm working in SDI mode?
Have a look at the options on the Options menu (SDI mode); if Don't open a file twice is checked, AkelPad opens the same file (even if it is changed!) in the same instance, closing the first. But if option is unchecked, opening the same file should open a new instance.
Yes, that's actually the behavior I was expecting. But, to my surprise, AkelPad DOESN'T open another instance when that option is unchecked :?
Whether it is the same file I'm trying to open, or a different file, AkelPad always reuses the same window, closing the previous file to open a new one.
File/New window should always open a new instance also, although then you have to open the file manually (instead of just double clicking on the file to open AkelPad). Have a look at the User Manual for more info at:
http://akelpad.sourceforge.net/en/download.php
Yes, that's right. The ONLY way I was able to get more than one instance is via "File -> New Window" but that is very cumbersome. I've already downloaded (and read! :lol: ) the User Manual. But the behavior I'm seeing is not what's described in the User Manual. Maybe a bug? Or maybe I'm doing something wrong? Could someone who's using AkelPad in SDI mode please confirm this behavior regarding single/multiple instances?
If you are a new user, then you might also want to take a look at the Plugins Manual at:
http://akelpad.sourceforge.net/en/plugins.php
Plugins provide many great features (Toolbar, Scripts, MinimizeToTray, etc.)!
I know! The plugins were one of the main reasons I chose AkelPad as a notepad replacement over many other alternative light text editors. I've already activated four or five plugins, and I've even customized the toolbar to add buttons for a couple or plugins more. Great feature!

Offline
Posts: 147
Joined: Fri Feb 08, 2008 6:41 pm
Location: British Columbia, Canada

Post by Surveyor »

city_zen wrote:to my surprise, AkelPad DOESN'T open another instance when that option is unchecked
Strange! Try this:
  1. Ensure AkelPad is set for registry usage (in Options/Settings/Registry tab).
  2. Set AkelPad for SDI usage. You should only be running a single instance at this point. AkelPad sets Registry/INI settings based on the last instance or tab (MDI) closed.
  3. Close AkelPad
  4. Delete <drive>\Program Files\AkelPad\AkelPad.ini if it exists
  5. Using Regedit, delete registry setting HKEY_CURRENT_USER\Software\Akelsoft\AkelPad\Options\SingleOpenProgram
  6. Open AkelPad
  7. Uncheck Options/Don't open a program twice
  8. Close AkelPad and test out behaviour
If it still doesn't work right, post a reply - Windows type, service pack, etc. and any unusual applications that might be running (drivers, etc.) which might interfere. Also, in Regedit, export HKEY_CURRENT_USER\Software\Akelsoft to a file and email it to me. This feature definitely works on my system.

Also, other posts indicate that outdated language files are an issue - set AkelPad to Internal language (ie. English or Russian, depending on download) before testing. This bypasses any language DLLs. In fact, try this first.

Offline
Posts: 5
Joined: Mon Oct 26, 2009 6:52 pm

Post by city_zen »

Surveyor wrote: If it still doesn't work right, post a reply - Windows type, service pack, etc. and any unusual applications that might be running (drivers, etc.) which might interfere. Also, in Regedit, export HKEY_CURRENT_USER\Software\Akelsoft to a file and email it to me. This feature definitely works on my system.

Also, other posts indicate that outdated language files are an issue - set AkelPad to Internal language (ie. English or Russian, depending on download) before testing. This bypasses any language DLLs. In fact, try this first.
Thanks for your help, Surveyor.
I did try both of your suggestions but none worked.
I'm sending you the Akelsoft Registry branch via email.
After trying both of your suggestions, I completely uninstalled AkelPad (files, settings, everything) and afterwards reinstalled it. Plain vanilla: internal language (English), default settings, no plugins running, etc.
The multiple instances feature still doesn't work :? :(

My system specs are:
  • Windows XP Professional SP3 (Spanish)
    "Normal" antivirus (Avira Antivir Personal)
    Windows firewall
    No HIPS
    No desktop enhancements/shells (like Aston and the like)
    VERY few startup programs
    No unusual drivers, I think (the ones I have are: video card, wireless mouse, bluetooth, Hamachi VPN, etc.)
I honestly can't think of anything in my system that could be interfering with Akelpad.

Any ideas?

Thanks

Offline
Site Admin
Posts: 6311
Joined: Thu Jul 06, 2006 7:20 am

Post by Instructor »

city_zen
Whenever I try to open a file in AkelPad in SDI mode, AkelPad closes the current file I'm working on.
Use Explorer (need file associations or notepad replacement) or file manager to open files. Another variant is the simple script:
OpenFileInNewInstance.js

Code: Select all

var AkelPad=new ActiveXObject("AkelPad.document");

var hMainWnd=AkelPad.GetMainWnd();
var hNewMainWnd;

if (hNewMainWnd=AkelPad.SendMessage(hMainWnd, 273 /*WM_COMMAND*/, 4102 /*IDM_FILE_CREATENEW*/, 0))
  AkelPad.SendMessage(hNewMainWnd, 273 /*WM_COMMAND*/, 4103 /*IDM_FILE_OPEN*/, 0);

Offline
Posts: 147
Joined: Fri Feb 08, 2008 6:41 pm
Location: British Columbia, Canada

Post by Surveyor »

Thanks, Instructor, for your comments. I re-read the Users Manual, and think I need to make this issue more clear; changes will be made immediately!
Instructor wrote: Use Explorer (need file associations or notepad replacement)
I need to modify my Users Manual - it is not clear as to predicted behaviour. Behaviour is applicable, as Instructor says, for files opened by (eg.) double clicking in Windows Explorer. It is implied that file association set in AkelPad should open file in AkelPad. In SDI mode, different files should open in new instances regardless of Don't open a file twice setting. The same file, however, will open in the same instance, or in a new instance depending on the Don't open a file twice setting.

In MDI mode, Don't open a program twice setting controls whether files (again, opened by association in Windows Explorer or similar application) open a new tab, or a new instance.

Does this work for you as described? If you are simply working in AkelPad (not opening files from Windows Explorer, etc.), then you have to use the File/New window method to create a new instance.

See here for revised copy of Users Manual.

Offline
Posts: 5
Joined: Mon Oct 26, 2009 6:52 pm

Post by city_zen »

Surveyor wrote:
Instructor wrote: Use Explorer (need file associations or notepad replacement)
I need to modify my Users Manual - it is not clear as to predicted behaviour. Behaviour is applicable, as Instructor says, for files opened by (eg.) double clicking in Windows Explorer. It is implied that file association set in AkelPad should open file in AkelPad. In SDI mode, different files should open in new instances regardless of Don't open a file twice setting. The same file, however, will open in the same instance, or in a new instance depending on the Don't open a file twice setting.

In MDI mode, Don't open a program twice setting controls whether files (again, opened by association in Windows Explorer or similar application) open a new tab, or a new instance.

Does this work for you as described? If you are simply working in AkelPad (not opening files from Windows Explorer, etc.), then you have to use the File/New window method to create a new instance.
Thanks Instructor and Surveyor.
Yes, that's the behavior I'm seeing. I didn't know that it was the behavior by design. I was hoping that there was a way to open another file in a new instance (other that "File -> New Window" -> "Open")
Maybe there is, by using the script that Instructor posted, but I don't know how it should be used :(
A little help on that would be appreciated.

Offline
Posts: 147
Joined: Fri Feb 08, 2008 6:41 pm
Location: British Columbia, Canada

Post by Surveyor »

city_zen,

Try creating a Send To link instead (to Program File/AkelPad/AkelPad.exe). I find this works quite well, especially for files which are not yet associated with AkelPad. There are some benefits also, re: opening multiple files (.txt) with a Send To link. MDI mode can open in multiple tabs; SDI in multiple instances. I don't think the Options have much effect in this case - experiment for the answer to that.

Re: Instructor's script
  1. Copy his script text
  2. Paste into a blank AkelPad document
  3. Save file as OpenFileInNewInstance.js in Program Files\AkelPad\AkelFiles\Plugs\Scripts\ folder.
  4. Read Plugins Manual (if you haven't already) - Scripts/Installation. There is actually a small procedure to getting Scripts installed.
  5. Open Scripts dialog by Options/Plug-ins.../Scripts::Main (double click)
  6. Select your new script, click Exec
  7. Continue with file load - script calls an open dialog via AkelPad internals.
Regards,

Offline
Posts: 5
Joined: Mon Oct 26, 2009 6:52 pm

Post by city_zen »

Thanks yet again, Surveyor.
I added the Send To item and it works like a charm.
I also followed your instructions and managed to install the OpenFileInNewInstance.js script. I'm now trying to add it to the toolbar. It's taking me a bit of digging in the forum (thanks to Google Translate, since I only know about 2 words in Russian :D ) and the User Manual, but I think I'll succeed in the end.
I started this thread by saying that AkelPad is a great little program. I now know it's got great support too :D
Post Reply