Jump to content

2nd SciTE-Instance with same script


BugFix
 Share

Recommended Posts

Hi,

by working in an large script, sometimes it's usefull to have two parts of this script side by side.

It's not possible to Tile/MDI SciTE. SciTE has an option to arrange the windows by opening an second instance (see chapter "# Window sizes and visibility" in properties). But by using this, you can't open the first instance maximized. And by closing the second instance has the other one always a small size.

Thats why i've made a launcher, to arrange two instances of SciTE automatically.

With a shortcut (i.e. Ctrl+Alt+T) will opened a second instance of SciTE with the current script. If you make changes in the script and want to toggle between both instances, it's recommended to save the script. Then are all changes available in both instances.

By closing of one instance will the other one shown on full screen (but if you don't like that, you can change the code to store the first opened size and restore it).

Standard config of SciTE allows no 2nd instance, you must add following line to your SciTEUser.properties:

check.if.already.open=0

To create the shortcut you must also add these lines:

# 43 SciTE-2ndWindow

command.43.*.au3="$(SciteDefaultHome)\SciTE.exe" "$(FilePath)"

command.name.43.*.au3=2nd SciTE Window

command.save.before.43.*.au3=1

command.is.filter.43.*.au3=1

command.shortcut.43.*.au3=Ctrl+Alt+T

Here i've used number 43. If you have no own entry in your SciTEUser.properties, you can start with number 36. Otherwise take the next one.

I've compiled the script and added to "Autostart". And now, everytime i want to see two parts of an script, i hit Ctrl+Alt+T and it's done.

Opt("TrayIconHide", 1)
Global $List
While True
    Do
        Sleep(500)
        $List = WinList('[CLASS:SciTEWindow]')
    Until $List[0][0] = 2
    WinMove($List[1][1], '', 0, 0, @DesktopWidth/2, @DesktopHeight)
    WinMove($List[2][1], '', @DesktopWidth/2, 0, @DesktopWidth/2, @DesktopHeight)
    Do
        Sleep(500)
        $List = WinList('[CLASS:SciTEWindow]')
    Until $List[0][0] = 1
    WinMove($List[1][1], '', 0, 0, @DesktopWidth, @DesktopHeight)
WEnd

SciTELauncher.au3

Best Regards BugFix  

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...