New scripts in scite/AHK with added settings Topic is solved

The popular SciTE-based AutoHotkey Script Editor
joed3isme
Posts: 5
Joined: 24 Dec 2023, 17:41

New scripts in scite/AHK with added settings

24 Dec 2023, 18:57

I searched and I searched but no can find! :headwall:
I want to have all my new scripts open in scite w/AHK with these parameters:

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance force ; this prevents the script from popping up the dialogue box warning if you start the program without shutting it down.
#MaxMem
DetectHiddenWindows, On ; unnecessary but left just in case of future changes.

I searched for hours to find how to add these to Sciteuser.properties which I believe is where to add the above. I looked at scite site,Googled and AHK Help but darned if I can find it. I am stumped and this is first time on forum.
Please help I would immensely appreciate it!

[Mod action: Moved topic from “Ask for Help (v2)”.]
User avatar
Datapoint
Posts: 296
Joined: 18 Mar 2018, 17:06

Re: New scripts in scite/AHK with added settings

24 Dec 2023, 22:46

I just tried this and it seems to work: viewtopic.php?p=480175#p480175
joed3isme
Posts: 5
Joined: 24 Dec 2023, 17:41

Re: New scripts in scite/AHK with added settings

25 Dec 2023, 12:33

Hi
Question is there not a way to edit the current default template for a new script in scite/AHK ,if so where is that located ???
Thanks
User avatar
Datapoint
Posts: 296
Joined: 18 Mar 2018, 17:06

Re: New scripts in scite/AHK with added settings

25 Dec 2023, 23:24

Look in C:\Windows\ShellNew\Template.ahk
joed3isme
Posts: 5
Joined: 24 Dec 2023, 17:41

Re: New scripts in scite/AHK with added settings

26 Dec 2023, 18:41

Hi
Thanks ,I edited that template before this question and it still comes up blank-untitled with SCite4AHK but the scriplet utility works, for pasting in to the blank script. I'll go with that for now! I'm just trying to get my bearings straight navigating through the folders and figuring out the whole scheme of things. I do appreciate your help, always!
Thanks so much!!
Joe
User avatar
Datapoint
Posts: 296
Joined: 18 Mar 2018, 17:06

Re: New scripts in scite/AHK with added settings  Topic is solved

26 Dec 2023, 19:39

I was able to get it to work in SciTE4AutoHotkey. For what it's worth, my files are in the following locations.
  • C:\Users\MYUSERNAME\Documents\AutoHotkey\SciTE\NewAhk.lua

    Code: Select all

    -- https://www.autohotkey.com/board/topic/54431-scite4autohotkey-v3004-updated-aug-14-2013/page-62#entry568765
    if props["FileNameExt"] == "" and editor.Length == 0 and not buffer.templateLoaded then
        f = io.open(os.getenv("windir").."\\ShellNew\\Template.ahk", "r")
        if f then
            t = f:read("*all")
            if t:sub(1, 3) == "\239\187\191" then  -- UTF-8 BOM
                t = t:sub(4)
                scite.MenuCommand(IDM_ENCODING_UTF8)
            end
            editor:append(t)
            editor:EmptyUndoBuffer()
            editor:SetSavePoint()
            f:close()
        end
        buffer.templateLoaded = true
    end
  • C:\Users\MYUSERNAME\Documents\AutoHotkey\SciTE\SciTEUser.properties

    Code: Select all

    extension.*.ahk=$(SciteUserHome)\NewAhk.lua
  • C:\Windows\ShellNew\Template.ahk

    Code: Select all

    ; AHK script template
    ...
Last edited by Datapoint on 30 Dec 2023, 07:10, edited 1 time in total.
joed3isme
Posts: 5
Joined: 24 Dec 2023, 17:41

Re: New scripts in scite/AHK with added settings

27 Dec 2023, 13:19

BINGO!!! :superhappy:
That did it! I'm not sure why I couldn't grasp it from your previous link?? Brain freeze or old age possibly :D .
I created the NewAhk.lua, copied the info in to that and added the SciTEUser.properties info in "docs\AHK\scite" and viola .
I spent pretty much since Christmas afternoon till now , just couldn't seem to decipher all I searched and your very helpful instruction
but when I saw your last post it clicked. So I had no link basically to C:\Windows\ShellNew\Template.ahk now I can edit that.
THANK YOU SO SO MUCH!!!
Joe

Return to “SciTE4AutoHotkey”

Who is online

Users browsing this forum: No registered users and 115 guests