AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

AutoHotkey - Template

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
Beastmaster
Guest





PostPosted: Tue Apr 06, 2004 1:31 pm    Post subject: AutoHotkey - Template Reply with quote

;
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
; Author: A.N.Other <myemail@nowhere.com>
;
; Script Function:
; Template AutoHotkey script.
;

Currently this header will be set by default if you use the desktops context menu (--> New\AutoHotkey script) to create an AHK template.

Would it make sense to replace/edit the current static version statement which is given in that header with a dynamic one which is linked by default to a currently used AHK.exe (maybe taken from his file property info)?

I've created a script to show what I mean Cool

Code:
FileGetVersion, Version, AutoHotkey.exe
FileAppend, `;`n`; AutoHotkey Version:`t%Version%`n`; Language:`t`tEnglish`n`; Used Platform:`t%A_OSVersion%`n`; Author:`t`tMy Name <myemail@nowhere.com>`n`;`n`; Script Function:`n`;`n`;, MyTemplate.ahk
Run, Notepad MyTemplate.ahk,, MAX


Of course the language could be taken from the regional settings (keyboard) and the currently logged user via the %USER% env var.
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10464

PostPosted: Tue Apr 06, 2004 3:16 pm    Post subject: Reply with quote

It's a great idea; unfortunately I don't even know where to begin on implementing it. This is because Windows' New Document feature is linked to a static template file stored in the system. When you create a "New AutoHotkey Script" using the Explorer, the OS copies this file but doesn't notify AutoHotkey in any way of what it's doing.

In other words, the "new document" feature is entirely contained and managed by the OS. There is no interaction with AHK so I don't see how to easily make the template dynamic. I'm pretty sure there is a hard way to do this, but it probably involves configuring the template to launch a program that dynamically creates the header.

I will keep this on the to-list, though it will probably be a long time before I can research it. Anyone else who happens to know how to program this is certainly welcome to do so.

Edit: It might be possible to have the OS launch a script such as yours instead of copying the template file. I'll look into it. Thanks for the suggestion.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group