Best way to use AHK to write a .ahk file?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
skyth540
Posts: 72
Joined: 24 Aug 2022, 10:07

Best way to use AHK to write a .ahk file?

Post by skyth540 » 28 Sep 2022, 15:53

I have a basic understanding of gui's, so I was planning on having a pop up box where someone would enter in the variable needed for different parts of a script that needs to be deployed. The actual output of what I want written into a script I can put together pretty easily I think. But what's the best way to turn code from clipboard or variable data into a .ahk file?

Lepes
Posts: 141
Joined: 06 May 2021, 07:32
Location: Spain

Re: Best way to use AHK to write a .ahk file?

Post by Lepes » 28 Sep 2022, 16:44

One method maybe FileAppend

Code: Select all

FileAppend,
(
::btw::by the way

;A line of text.
;By default, the hard carriage return (Enter) between the previous line and this one will be written to the file.
;    This line is indented with a tab; by default, that tab will also be written to the file.
;Variable references such as %Var% are expanded by default.
), D:\My File.ahk 
Run, D:\My File.ahk

skyth540
Posts: 72
Joined: 24 Aug 2022, 10:07

Re: Best way to use AHK to write a .ahk file?

Post by skyth540 » 28 Sep 2022, 16:58

Lepes wrote:
28 Sep 2022, 16:44
One method maybe FileAppend

Code: Select all

FileAppend,
(
::btw::by the way

;A line of text.
;By default, the hard carriage return (Enter) between the previous line and this one will be written to the file.
;    This line is indented with a tab; by default, that tab will also be written to the file.
;Variable references such as %Var% are expanded by default.
), D:\My File.ahk 
Run, D:\My File.ahk

beauty, this looks like it thanks

Post Reply

Return to “Ask for Help (v1)”