AkelPad Forum Index AkelPad
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Open file in NEW instance?

 
Post new topic   Reply to topic    AkelPad Forum Index -> Discussion (English)
View previous topic :: View next topic  
Author Message
city_zen



Joined: 26 Oct 2009
Posts: 5

PostPosted: Mon Oct 26, 2009 7:06 pm    Post subject: Open file in NEW instance? Reply with quote

Hi,

I'm just starting to use AkelPad. From what I've discovered so far, it's a great little program Smile
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
Back to top
View user's profile Send private message
Surveyor



Joined: 08 Feb 2008
Posts: 146
Location: British Columbia, Canada

PostPosted: Tue Oct 27, 2009 4:03 pm    Post subject: Reply with quote

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...
Back to top
View user's profile Send private message Send e-mail
city_zen



Joined: 26 Oct 2009
Posts: 5

PostPosted: Wed Oct 28, 2009 4:29 am    Post subject: Reply with quote

Surveyor wrote:
Welcome aboard!


Thank you Very Happy

Quote:
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 Confused
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.

Quote:
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! Laughing ) 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?

Quote:
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!
Back to top
View user's profile Send private message
Surveyor



Joined: 08 Feb 2008
Posts: 146
Location: British Columbia, Canada

PostPosted: Wed Oct 28, 2009 5:53 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail
city_zen



Joined: 26 Oct 2009
Posts: 5

PostPosted: Thu Oct 29, 2009 5:21 am    Post subject: Reply with quote

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 Confused Sad

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
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 5368

PostPosted: Thu Oct 29, 2009 6:25 am    Post subject: Reply with quote

city_zen
Quote:
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:
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);
Back to top
View user's profile Send private message Send e-mail
Surveyor



Joined: 08 Feb 2008
Posts: 146
Location: British Columbia, Canada

PostPosted: Thu Oct 29, 2009 10:05 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail
city_zen



Joined: 26 Oct 2009
Posts: 5

PostPosted: Fri Oct 30, 2009 3:37 am    Post subject: Reply with quote

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 Sad
A little help on that would be appreciated.
Back to top
View user's profile Send private message
Surveyor



Joined: 08 Feb 2008
Posts: 146
Location: British Columbia, Canada

PostPosted: Fri Oct 30, 2009 4:15 am    Post subject: Reply with quote

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,
Back to top
View user's profile Send private message Send e-mail
city_zen



Joined: 26 Oct 2009
Posts: 5

PostPosted: Sat Oct 31, 2009 3:40 am    Post subject: Reply with quote

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 Very Happy ) 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 Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AkelPad Forum Index -> Discussion (English) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


SourceForge.net Logo Powered by phpBB © 2001, 2005 phpBB Group