Jump to content

Recommended Posts

Posted (edited)

Hi, 

i'v just uploaded my latest project: Simple Snippet Manager to the Downloads. area :
mainwindow-examplelanguage.png.b33aaa19476a2d4c3c41394ba329a258.png

 


 The intended usage is to select a Snippet, and to copy it's contents into your favorite Editor.
    The Copy/Paste process happens over the (windows)Clipboard. 
    The previous clipboard content is not restored.

    There is a time limit of 60 seconds, in which the pasting of the text is allowed (starting when the App window gets inactive).  
    The Hotkey is reenabled, when the main Window is activated.
    
    This is a File/Folder based manager. 
    The App is configured to hold 4000 files and 400 folders with searching depth of 5 sub-folders.
    
    The root folder is freely selectable, but it  should be a Folder with writing permission.
    Please install the App in a folder with Writing permission, too. 
    This App only uses an .ini file to save it's configuration, which has to be in the same folder as the App.
    
First configuration:

1. Open the config Window.
2. Enter the Language name, create or seek a root folder, enter an extension.
3. Click on Set button.
4. Click on the Exit button.

The Language configuration is done, adding files or folders are needed:

 1. Select the language from the dropbox list, and click on Get Lang button.
2a. Right Click on the root folder, chose New folder to add categories.
2b. or chose New/Edit file to open the builtin text editor
 3. Paste or Write a snippet-code, enter a filename and save it.
 
 (Repeat the 3. as needed)
 
Usage:

Select a language, then click on Get Lang button.
Choose a file with the left mouse button.
Check if the code was loaded in the Textarea at the bottom.
Switch to your Sourcecode editor, and press the Hotkey (default= Ctrl/Strg b) to copy and paste the text.

There is a time limit of 60 seconds, after the main window gets inactive, in which the copy&pasting is allowed.

Changelog:

V1.02        (24.06.2020)
            Addition: Undocumented ini setting: StartLoadLastUsedLanguage
                      Setting this to 1 (default value) will now reload the Last used language at start.
                      Last used language counts for the Language, selected with [Get Lang] button. The [Config] button will delete the last used language.
                      LastUsedLanguageNr, LastUsedLanguageName ini settings are used internaly for the above function.
             Added version string to the main Window title.

V1.01        (23.06.2020)
            Bugfix    : Starting the App without the ini file now sets the correct starting Hotkey (Ctrl b)
            Addition: Clipboard is saved, before pasting, and restored after pasting. (May work with text data only. p.s. untested!)

Edited by Dan_555
Updates

~Dan~ :Emu.Zone now with Desktop Pets / DeskMates - (Bugfixed UniScrMate 4.1)

Share this post


Link to post
Share on other sites

wow, this brought back some old memories.  Myself and GaryFrost built separate Snippet holders back in 2006.

Looks like the code is gone from those old threads though I found mine and re-uploaded it.  But it doesn't seem to work anymore.

There is a section that shows how to edit Scite to add your own hotkey so you can highlight code within Scite hit a hotkey and save it into your Snippet Manager.

You should be able to save and restore the clipboard by storing the existing to a var with ClipGet() and once you are done with your insert, put back with ClipPut()

Also, I don't see the code in your post.

 

 

Here is GaryFrost's version that for a while was part of the Scite install but I don't see the code, though there is a link to the compiled download.

 


hmm... I guess I have to have a signature...

Share this post


Link to post
Share on other sites
Posted (edited)

Ah, right, the source code and the executables are in the download section. Simple Snippet Manager 

Because it has over 1k of lines, i didn't pasted it.

I have downloaded cSnippet (sometime) last year, and today again, and it gives an error when i switch to Scite ... 

I guess if it worked, i would probably use it, instead of writing a new one.

 

Quote

You should be able to save and restore the clipboard by storing the existing to a var with ClipGet() and once you are done with your insert, put back with ClipPut()

 

Edit: Uploaded a new version with this addition (and a bugfix).

Edited by Dan_555

~Dan~ :Emu.Zone now with Desktop Pets / DeskMates - (Bugfixed UniScrMate 4.1)

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Dan_555
      Simple Snippet Manager (AutoIt v3.3.14.5)
       The intended usage is to select a Snippet, and to copy it's contents into your favorite Editor.
          The Copy/Paste process happens over the (windows)Clipboard. 
          The previous clipboard content is not restored.
          There is a time limit of 60 seconds, in which the pasting of the text is allowed (starting when the App window gets inactive).  
          The Hotkey is reenabled, when the main Window is activated.
          
          This is a File/Folder based manager. 
          The App is configured to hold 4000 files and 400 folders with searching depth of 5 sub-folders.
          
          The root folder is freely selectable, but it  should be a Folder with writing permission.
          Please install the App in a folder with Writing permission, too. 
          This App only uses an .ini file to save it's configuration, which has to be in the same folder as the App.
          
      First configuration:
      1. Open the config Window.
      2. Enter the Language name, create or seek a root folder, enter an extension.
      3. Click on Set button.
      4. Click on the Exit button.
      The Language configuration is done, adding files or folders are needed:
       1. Select the language from the dropbox list, and click on Get Lang button.
      2a. Right Click on the root folder, chose New folder to add categories.
      2b. or chose New/Edit file to open the builtin text editor
       3. Paste or Write a snippet-code, enter a filename and save it.
       
       (Repeat the 3. as needed)
       
      Usage:
      Select a language, then click on Get Lang button.
      Choose a file with the left mouse button.
      Check if the code was loaded in the Textarea at the bottom.
      Switch to your sourcecode editor, and press the Hotkey (default= Ctrl/Strg b) to copy and paste the text.
      There is a timelimit of 60 seconds, after the main window gets inactive, in which the copy&pasting is allowed.
       
      The Download includes:
      32 + 64bit exe, sourcecode, icon, read me text and 2 Instructional Helpfiles in Html and PDF format.
    • By Colduction
      Hi guys!, recently i needed to measure two functions and detect fastest one then i decided to write and share this tiny script for compare, measure and detect fastest functions easily.

      It's such as snippets, i hope you find it useful :)❤
       
      #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 #include-once ; #FUNCTION# ==================================================================================================================== ; Name...........: _FuncSpeedComparator ; Description ...: Compares and measures speed of two functions and shows fastest one. ; Syntax.........: _FuncSpeedComparator($s1stFunc, $s2ndFunc [,$iCallNum, $iResultType]) ; Parameters ....: $s1stFunc - First function that should be compared and measured ; $s2ndFunc - Second function that should be compared and measured ; $iCallNum - [Optional] Number of times function should be called ; Default value is 100 ; $iResultType - [Optional] Type of output must be one of the following numbers: ; 1 ; Results will written in AutoIt Console Output ; 2 ; Results will be as a Message Box ; 3 ; Results will written in AutoIt Console Output and then shows as a Message Box ; Default value is 1 ; Return values .: Success - Returns string ; Failure - Returns False or empty string ; Author ........: Colduction (Ho3ein) ; Modified.......: ; Remarks .......: Function names should be written as string (inside of two Double Quotation or Quotation) to be executed and be measured ; Example .......; _FuncSpeedComparator('ConsoleWrite("10101010101")', 'ConsoleWrite("Hello World!")', 500, 3) ; =============================================================================================================================== Func _FuncSpeedComparator($s1stFunc = "", $s2ndFunc = "", $iCallNum = 100, $iResultType = 1) If Not StringRegExp($s1stFunc, "^[a-zA-Z0-9_]+\x28(.*?)\x29$") Or Not StringRegExp($s2ndFunc, "^[a-zA-Z0-9_]+\x28(.*?)\x29$") Or Not StringRegExp($iCallNum, "^\p{Nd}*$") Or Not StringRegExp($iResultType, "^\p{Nd}*$") Then ; Human mistake preventative stage. Return False Else ; Measure stage. ;; First function measurement. Local $hTimer_1stFunc = TimerInit() For $i = 1 To $iCallNum Execute($s1stFunc) Next Local $iDiff_1stFunc = TimerDiff($hTimer_1stFunc) ;; Second function measurement. Local $hTimer_2ndFunc = TimerInit() For $i = 1 To $iCallNum Execute($s2ndFunc) Next Local $iDiff_2ndFunc = TimerDiff($hTimer_2ndFunc) ; Fastest function detector stage. Local $sFastestFunc = "" If $iDiff_1stFunc = $iDiff_2ndFunc Then $sFastestFunc = "Both of them" ElseIf $iDiff_1stFunc < $iDiff_2ndFunc Then $sFastestFunc = StringRegExpReplace($s1stFunc, "(\x28).*", "") Else $sFastestFunc = StringRegExpReplace($s2ndFunc, "(\x28).*", "") EndIf ; Results stage. Local $sResultText = @CRLF & '#Fastest Function: "' & $sFastestFunc & '"' & @CRLF & @CRLF & '1) "' & StringRegExpReplace($s1stFunc, "(\x28).*", "") & '" time elapsed: (' & $iDiff_1stFunc & ") ms" & @CRLF & '2) "' & StringRegExpReplace($s2ndFunc, "(\x28).*", "") & '" time elapsed: ' & "(" & $iDiff_2ndFunc & ") ms" & @CRLF If $iResultType = 1 Or Not StringRegExp($iResultType, '^[1|2|3]{1}$') Then ; Output as ConsoleWrite. ConsoleWrite($sResultText) ElseIf $iResultType = 2 Then ; Output as MsgBox. MsgBox(64, "Result: " & $sFastestFunc, $sResultText) ElseIf $iResultType = 3 Then ; Output as both ConsoleWrite & MsgBox. ConsoleWrite($sResultText) MsgBox(64, "Result: " & $sFastestFunc, $sResultText) EndIf EndIf EndFunc ;==>_FuncSpeedComparator  
      _FuncSpeedComparator.au3
×
×
  • Create New...