Sunaj Posted January 6, 2009 Share Posted January 6, 2009 (edited) 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 ;==>fDCPathWithNoFileOpenSciTESession.exe Edited January 6, 2009 by Sunaj [list=1][*]Generic way to detect full path to default browser, List/ListView Events Using GuiRegisterMsg (detect doubleclick and much more)[*]Using dllcall for full control over fileopendialog, Make DirMove act somewhat normally (by circumventing it...)[*]Avoid problems with "&" (chr(38)) in code, Change desktop maximized area/workspace (fx to make deskbar type app)[*]Change focus behavior when buttons are clicked to work closer to 'standard windows' app[*](Context) Menus With Timed Tooltips, Fast Loops & Operators in AU3[*]Clipboard UDF, A clipboard change notification udf[/list] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now