Append to script that is also #Included? Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
User avatar
kunkel321
Posts: 1149
Joined: 30 Nov 2015, 21:19

Append to script that is also #Included?

06 May 2024, 11:16

Hi All,
Given this 'main' script

Code: Select all

#SingleInstance
#Requires AutoHotkey v2+
#Include "included script.ahk"
; my main file

::;append::
{
	Funct()
	FileAppend("new text`n", A_ScriptDir "included script.ahk")
	SoundBeep
}
And this included script

Code: Select all

#SingleInstance
#Requires AutoHotkey v2+
; this file is "included script.ahk"
Funct()
{
	MsgBox 'hello'
}

/* want "new text" to be appended down here. 

The function call works fine, but the Append is not working. Is there a straight forward way for this to work?
ste(phen|ve) kunkel
RussF
Posts: 1298
Joined: 05 Aug 2021, 06:36

Re: Append to script that is also #Included?  Topic is solved

06 May 2024, 11:35

Try this:

Code: Select all

FileAppend("new text`n", A_ScriptDir "\included script.ahk")
Russ
User avatar
kunkel321
Posts: 1149
Joined: 30 Nov 2015, 21:19

Re: Append to script that is also #Included?

06 May 2024, 11:47

Yep -- that was it. Thanks Russ!
ste(phen|ve) kunkel

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: niCode, ntepa, TAC109 and 54 guests