Jump to content

Recommended Posts

Posted (edited)

This is a little project I started knowing it was over my head to intentionally raise my own experience bar.
Pretty Simple Concept and its finally working like I want it to.
 
The Basic Idea:
 
An exe you copy into your Snippet folder and run from there with a shortcut ( or w/out ).
 
Top Part of GUI
Get Files - Creates a ListView of all au3 file in the WorkingDir ~ >_RecFileListToArray Thanks M23 !!
Clear - clears last search otherwise new search/GetFiles is appended (gets full quick)
File Search - search through the WorkingDir for a Keyword ~ >_FindInFile Thanks guinness !!
Far Right is a label with the Path of your Working Directory
 
Bottom Part    All of these commands work with The Selected File Path From top part:
Text Search - searches though preview window for text like F3 (find next) Thanks M23 !!
Open in SciTE - Duh...
Preview - Shows Preview of Selected File Path in Bottom window with Syntax Hi Liting ~ >RESH Thanks Beege
Throw String - Experimental, Sends Selected Text to last Cursor Position in active tab in SciTE
                         (now works w' multiple lines) Only works with one line...  >Thanks Jos, guinness 
 
Everything you need to try it is in the zip file.
Constructive Critics and Suggestions are welcome ;-)
 
Some Pics:
 
sb_tut.gif
 
 
Here you see a search for Text in File "@ScriptDir". All the files that have this in them will be listed
Then search through the Preview for each instance of "@ScriptDir" until you find the one you want.
 
sb_tut_srch.gif

 

  Reveal hidden contents


 
SnippetBrowser1.0.zip
SnippetBrowser_1.0.1.zip   ~   update: 14 Dec 2013
SnippetBrowser_1.0.1.zip   ~   update: 18 Dec 2013 
SnippetBrowser_1.0.2.zip   ~   update: 26 Dec 2013
Bill

post-56351-0-97561800-1386870674_thumb.j

post-56351-0-63608400-1386870810_thumb.j

Edited by l3ill
Posted

Func _SciTE_Send_Command($hWnd, $hSciTE, $sString)
    If StringStripWS($sString, $STR_STRIPALL) = '' Then
        Return SetError(2, 0, 0) ; String is blank.
    EndIf
    $sString = ':' & Dec(StringTrimLeft($hWnd, 2)) & ':' & $sString
    Local $tData = DllStructCreate('char[' & StringLen($sString) + 1 & ']') ; wchar
    DllStructSetData($tData, 1, $sString)

    Local Const $tagCOPYDATASTRUCT = 'ptr;dword;ptr' ; ';ulong_ptr;dword;ptr'
    Local $tCOPYDATASTRUCT = DllStructCreate($tagCOPYDATASTRUCT)
    DllStructSetData($tCOPYDATASTRUCT, 1, 1)
    DllStructSetData($tCOPYDATASTRUCT, 2, DllStructGetSize($tData))
    DllStructSetData($tCOPYDATASTRUCT, 3, DllStructGetPtr($tData))
    _SendMessage($hSciTE, $WM_COPYDATA, $hWnd, DllStructGetPtr($tCOPYDATASTRUCT))
    Return Number(Not @error)
EndFunc   ;==>_SciTE_Send_Command
Func _SciTE_InsertText($sString)
    ; $sString = _GUICtrlRichEdit_GetSelText($hEdit) << Do this on line 77, not in this wrapper function.
    Return _SciTE_Send_Command(0, WinGetHandle("DirectorExtension"), "insert:" & $sString)
EndFunc   ;==>_SciTE_InsertText

Nice idea. Here are a couple of updates to some of those function(s)...

Also you're passing $sString to _SciTE_InsertText() on line 77, but you're not actually declaring it. Try not to use Global variables if you can, which from what I can see you don't need to use any in this script. Plus, my username is missing another n. --_0

 

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

Thanks guinness,

  sorry about msp your un, I am pretty sure that was a Tidy error :ermm:

And thanks for the updates / suggestions will fix ASAP.

While Ive got yer attention, I was curious as to how would you go about fixing the Throw String Func to:

  • Add a carriage return after pasting ( as to prepare for next paste w/out need to change windows )
  • Ability to select and throw more than one line @ a time.

That whole function was a CCP and the part of my script that I dont fully comprehend.

cya,

Bill

Posted (edited)

All of these functions can be found in SciTE Jump under SciTE.au3.

Open in SciTE, don't use ShellExecute, instead use..

Func _SciTE_Open($sFilePath)
    Return _SciTE_Send_Command(0, WinGetHandle("DirectorExtension"), 'open:' & StringReplace($sFilePath, '\', '\\'))
EndFunc   ;==>_SciTE_Open

Ideally WinGetHandle("DirectorExtension") should be a Global variable or something. You can see how I do it in SciTE.au3.

Why not just append @CRLF to $sString = _GUICtrlRichEdit_GetSelText($hEdit) & @CRLF and then pass $sString to _SciTE_InsertText()? Then with your final problem, can you do multi selection in an edit control? Find out the answer by searching around a little.

I didn't give you that insert text did I? As it's wrong >>

Func _SciTE_InsertText($sString)
    $sString = StringReplace($sString, '\', '\\')
    _SciTE_ReplaceMarcos($sString)
    Return _SciTE_Send_Command(0, WinGetHandle('DirectorExtension'), 'insert:' & $sString)
EndFunc   ;==>_SciTE_InsertText

Func _SciTE_ReplaceMarcos(ByRef $sString)
    $sString = StringReplace($sString, @TAB, '\t')
    $sString = StringReplace($sString, @CR, '\r')
    $sString = StringReplace($sString, @LF, '\n')
EndFunc   ;==>_SciTE_ReplaceMarcos
Edited by guinness

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

Feature Request: Use modern colour scheme instead of the old one.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted (edited)

  Quote

 

Why not just append @CRLF to $sString = _GUICtrlRichEdit_GetSelText($hEdit) & @CRLF and then pass $sString to _SciTE_InsertText

:idea:  Sad.  I actually thought about trying that and then didnt because I couldnt allow myself to believe it could be that simple.

  Quote

 

()? Then with your final problem, can you do multi selection in an edit control? Find out the answer by searching around a little.

 

Yes. Multiselection is possible but now it only throws the first line. I will study up on this... these 2 things were on the ToDo list for an update down the road along with an ADDSNIPPET func.

  Quote

 

Feature Request: Use modern colour scheme instead of the old one.

 

Would gladly Oblige...but I have no idea what you mean... :

Edit: are you referring to the syntax hilites?

Thanks for your time!

Bill

Edited by billo
Posted (edited)

Yeah, I meant for the highlighting in RESH. Also see my edit above with a fix to the insert text function. I am working on a snippet holder for SciTE Jump over Christmas by the way.

Edit: Then I again I might not, but all the functions are there, it's just a matter of putting the pieces together.

Edited by guinness

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

OK, but you can see it wasn't escaping TAB, CR, LF and . My updated version stripped from SciTE Jump can do this.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted
---------------------------
AutoIt Error
---------------------------
Line 468  (File "C:UsersDOCDesktopSnippetBrowser1.0RESH.au3"):
 
Local $aRet = DllCallAddress('uint', DllStructGetPtr($tMem), 'struct*', $tRevIndex, 'struct*', $tSource, 'struct*', $tOutput, 'uint', (@AutoItX64 ? $iLen : $iLen / 4))
Local $aRet = DllCallAddress('uint', DllStructGetPtr($tMem), 'struct*', $tRevIndex, 'struct*', $tSource, 'struct*', $tOutput, 'uint', (@AutoItX64 ^ ERROR
 
Error: Unable to parse line.
---------------------------
OK   
---------------------------
  • Moderators
Posted

DjForfun,

You need the Beta version to run that new ternary syntax. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted (edited)

To do list:

  Quote

 

Feature Request: Use modern colour scheme instead of the old one.

Done

Updated Functions Insert and Open ( updates from guinness ~ Thanks !) 

Done

Add Carriage Return Function to Throw String

Could not get it to work with the suggested solution

And finally decided against it because most of the time I am nesting a one-liner in between two other lines

Multi-Line Throw String

coming soon...maybe

P.S. also updated all MSP guinness' :P  ...( I think...) :ermm:

Edited by billo
Posted
  On 12/14/2013 at 5:53 PM, billo said:

P.S. also updated all MSP guinness' :P  ...( I think...) :ermm:

Still mistakes there with my name. Plus it's Beege not Beeje.

I also tried my suggestion of $sString = _GUICtrlRichEdit_GetSelText($hEdit) & @CRLF and it worked for me. Unless I misunderstood your point billo.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

  On 12/14/2013 at 6:12 PM, guinness said:

Still mistakes there with my name. Plus it's Beege not Beeje.

 

I also tried my suggestion of $sString = _GUICtrlRichEdit_GetSelText($hEdit) & @CRLF and it worked for me. Unless I misunderstood your point billo.

Okay, I think thats all of them...

Yes your right. it does work. I had added it quickly to test it before uploading not planning on it being part of this update.

Turns out I added it to the wrong line  :ermm: Got lost in my own code :oops:

No of course that has never happened to anyone but me, I know :whistle:  

Posted (edited)

Directions to add a shortcut to your Scite Tools Menu:

Click on "Options" and choose Open au3.properties

  Reveal hidden contents

post-56351-0-89036600-1387745368_thumb.j

Scroll down to about line #265 and find the highest numbered Tool, in this case "# 34 Generate UDF header"

Insert the following: (important !! change the path to match your own)

  Reveal hidden contents

Should look like this:

  Reveal hidden contents

post-56351-0-72750000-1387745868_thumb.j

Save and restart SciTE

SnippetBrowser is now startable from the Tool Menu or by Keyboard Shortcut Ctrl+Alt+S

Edited by l3ill
Posted

Somewhat Larger update:

Added Updated RESH file fixed a small bug with the IniRead Highlighting ~ once again... Thanks Beege!

Added New _FileListToArrayRec to replace the one that needed the extra UDF - Still M23's work 

Added Turn Off Tool Tips ChecBox -  they get pesky after a while...

Updated the pics with Animated GIFS to see better how it works.

  • 1 year later...

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
  • Recently Browsing   0 members

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