Jump to content
Sign in to follow this  

Snippets Tray Tool

Recommended Posts



This program put little snippets we all like to use (i assume) into a tray menu so we don't have to look for them anymore.

the only thing u need to do is make a map name it Snippets and put your snippets in there.(note: The Snippets Tray Tool doesn't go in there but in the same place as the folder is)

The script: (note: to easy change the folder name to your own liking just open the script in scite and ctrl + f and look for Snippets and replace those 2 names with the name u want to use)

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <File.au3>
#include <GUIConstantsEx.au3>
#include <TrayConstants.au3>
Opt("TrayMenuMode", 3)
Opt("TrayIconHide", 0)
Opt("GUIResizeMode", 1)
Opt("TrayIconDebug", 1)
Opt("TrayAutoPause", 0)
Opt("MouseCoordMode", 2)
Opt("GUIOnEventMode", 1)
Opt("MustDeclareVars", 0)
Opt("GUIEventOptions", 1)
Opt("TrayOnEventMode", 0)
Opt("ExpandEnvStrings", 1)
Opt("WinDetectHiddenText", 1)

Local $PLTray, $PSTray, $STTray, $NTray, $PTray, $CTTray, $ExitItem
Local $Au3filesArray, $Item, $State, $Msg, $GuiMsg, $CursorInfo, $txt


$ExitItem = TrayCreateItem("Close")
TrayItemSetOnEvent(-1, "Quit")



    $Msg = TrayGetMsg()
    If $Msg > 0 Then
        $txt = TrayItemGetText($Msg)
        ConsoleWrite('$txt ' & $txt & @CRLF)
        If $txt = 'Close' Then Quit()
        ConsoleWrite(@ScriptDir & '\' & $txt & @CRLF)
        Run("C:\Program Files (x86)\AutoIt3\SciTE\SciTE.exe " & @ScriptDir & '\' & "Snippets" & '\' & $txt)


Func SrchAdd()
    $Au3filesArray = _FileListToArray(@ScriptDir & '\'& "Snippets" & '\', '*.au3', 1, 0)
    ConsoleWrite('$Au3filesArray[1] ' & $Au3filesArray[1] & @CRLF)
    For $i = 1 To $Au3filesArray[0]
        $Au3filesArray[$i] = TrayCreateItem($Au3filesArray[$i])
        TrayItemSetOnEvent($Au3filesArray[$i], $Au3filesArray[$i])
EndFunc   ;==>SrchAdd


Func Minimize()
    WinSetState('', '', @SW_MINIMIZE)
EndFunc   ;==>Minimize

Func Restore()
    WinSetState('', '', @SW_RESTORE)
EndFunc   ;==>Restore

Func Quit()
EndFunc   ;==>Quit


The guy behind this code is careca <-- i justĀ edited the script a little bit so u u don't get a gui with a button anymore to load the snippets in the tray menu.

If you have any questions feel free to comment and i will try to help you :)

reason i uploaded this script is because i think a lot of people would like it.


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

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.