Jump to content

OpenSciTESession


Sunaj
 Share

Recommended Posts

Function is as advertised by topic description; if you have SciTE installed in default AutoIT folder you can simply download the exe file and associate *.session with it. This script is an adoption of this Python script [http://code.activestate.com/recipes/572158/] and is frankly highly useful if you work with several sessions and do not like opening stuff up from within SciTE itself. Enjoy!

Edit: forgot to mention that the exe file includes a nice icon - works well to automatically create visually appealing icon for the *.session files.

If UBound($CmdLine) <= 1 Then Exit
If StringInStr($CmdLine[1],".session") = 0 Then Exit
Run("C:\Program Files\AutoIt3\SciTE\SciTE.exe" & " -loadsession:" & fDCFileFrmPath($CmdLine[1]),fDCPathWithNoFile($CmdLine[1]))

Func fDCFileFrmPath($sPath)
    $iCharsFrmRight = StringLen($sPath) - StringInStr($sPath, "\", 2, -1) ; "\" is to be found so many chars from left, now subtract from the length..etc.
    $sFileNamePlusExt = StringRight($sPath, $iCharsFrmRight) ; cut from right and return filename plus ext
    Return $sFileNamePlusExt ; return filename without ext
EndFunc   ;==>fDCFileFrmPath

Func fDCPathWithNoFile($sPath)
    $iCharsFrmLeft = StringInStr($sPath, "\", 2, -1) ; "\" is to be found so many chars from right
    $sPathMinusFile = StringLeft($sPath, $iCharsFrmLeft) ; cut from left and return filename plus ext
    Return $sPathMinusFile ; return filename without ext
EndFunc   ;==>fDCPathWithNoFile

OpenSciTESession.exe

Edited by Sunaj
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...