Sign in to follow this  
Followers 0
cppman

Template Creator

3 posts in this topic

Here is a little program i wrote..

basically it replaces the Default AutoIt template with your own custom one...

just thought it would be useful...

because the default one gets a bit annoying..

#include <GUIConstants.au3>
#include <File.au3>
$Form1 = GUICreate("Template Cerator", 626, 341, 187, 114)
$TemplateData = GUICtrlCreateEdit("", 16, 40, 593, 257, -1, $WS_EX_CLIENTEDGE)
GUICtrlCreateLabel("Template Editor", 256, 8, 78, 17)
$SaveTemplate = GUICtrlCreateButton("Save Template", 216, 304, 193, 25)
$SetTemplate = GUICtrlCreateButton("Set Template", 16, 304, 193, 25)
$OpenTemplate = GUICtrlCreateButton("Open Template", 416, 304, 193, 25)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $SaveTemplate
        _SaveTemplate()
    Case $msg = $SetTemplate
        _SetTemplate()
    Case $msg = $OpenTemplate
        _OpenTemplate()
    EndSelect
WEnd
Exit

Func _SaveTemplate()
    $File = FileSaveDialog("Save Template As...", @DesktopDir, "Au3 Files (*.au3)")
    $oFile = FileOpen($File, 1)
    $oFile_Write = FileWrite($oFile&".au3", GUICtrlRead($TemplateData))
    Return 0
EndFunc

Func _SetTemplate()
    $File = FileOpenDialog("Set Template...", @DesktopDir, "Au3 Files (*.au3)")
    FileCopy($File, @WindowsDir & "\ShellNew\Template.au3", 1)
    Return 0 
EndFunc

Func _OpenTemplate()
    $File = FileOpenDialog("Set Template...", @DesktopDir, "Au3 Files (*.au3)")
    $Contents = FileRead($File)
    GUICtrlSetData($TemplateData, $Contents)
EndFunc

Share this post


Link to post
Share on other sites



Cool Idea...To think all this time I was using a cut & paste from notepad!

Func _MakeDinner($ImHungry)

If CallWifeCellPhone == -1 Then DialLawyer($DivorceHer)

EndFunc

Share this post


Link to post
Share on other sites

Func _MakeDinner($ImHungry)

If CallWifeCellPhone == -1 Then DialLawyer($DivorceHer)

EndFunc

lmao!!!!

thanks...

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  
Followers 0