<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Внесение текста в AHK скрипт через Edit GUI]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=16808&amp;type=atom" />
	<updated>2021-12-08T12:30:03Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=16808</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Внесение текста в AHK скрипт через Edit GUI]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=151082#p151082" />
			<content type="html"><![CDATA[<p>Мне кажется проще использовать &#039;FileSelectFile&#039; и вызывать его по кнопке в трее допустим.<br /></p><div class="codebox"><pre><code>#Persistent

Menu, Tray, NoStandard
Menu, Tray, Add, % &quot;Select file&quot;, selectFile
Menu, Tray, add
Menu, Tray, Add, % &quot;Close script&quot;, closeScript

global logFile := &quot;&quot;

selectFile()

setTimer, readLog, 50
return

readLog()
{
	if (!logFile)
		return

	loop, read, % logFile
        last_line  := A_LoopReadLine

    If last_line contains Unknown command. Type &quot;help&quot; for help.
    {
        Send {t}
        Sleep 1000
        Send, /skyblock
        SendInput {enter}
        Sleep 3000
        Send {space down}
        Sleep 50
        Send {space up}
        Sleep 50
        Send {space down}
        Sleep 50 
        Send {space up}
        Sleep 2000
    }
}

selectFile()
{
	FileSelectFile, selectedFile, 3,, Select log file, Log file (*.txt; *.log)
	if (errorLevel)
	{
		return
	}

	if (!selectedFile)
	{
		selectFile()
	}

	logFile := selectFile
}

closeScript()
{
	exitApp
}</code></pre></div><p>В вашем варианте, я думаю можно попробовать так:<br /></p><div class="codebox"><pre><code>Gui, Add, Edit, x12 y7 w451 h57 vText, test ; окно Edit, где я записываю путь к файлу
Gui, Add, Button, x12 y74 w134 h38 gKey , apply
Gui, Show, w479 h153, Untitled GUI
return

Key:
Gui, Submin, NoHide
return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Phoenixxx_Czar]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34426</uri>
			</author>
			<updated>2021-12-08T12:30:03Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=151082#p151082</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Внесение текста в AHK скрипт через Edit GUI]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=151051#p151051" />
			<content type="html"><![CDATA[<p>Здравствуйте, мне нужна помощь со скриптом AHK</p><p>Код:<br /></p><div class="codebox"><pre><code>Gui, Add, Edit, x12 y7 w451 h57 vText, test ; окно Edit, где я записываю путь к файлу
Gui, Add, Button, x12 y74 w134 h38 gKey , apply
Gui, Show, w479 h153, Untitled GUI
return

Key:
GuiControlGet, Text
?
?

GuiClose:
ExitApp

loop
{
	loop, read, %Text%  ; здесь нужно вставить то, что я написал в edit
        last_line  := A_LoopReadLine
        If last_line contains Unknown command. Type &quot;help&quot; for help.
        {
        Send {t}
        Sleep 1000
        Send, /skyblock
        SendInput {enter}
        Sleep 3000
        Send {space down}
        Sleep 50
        Send {space up}
        Sleep 50
        Send {space down}
        Sleep 50 
        Send {space up}
        Sleep 2000
        }
}
F2:: pause
</code></pre></div><p>Обыскал форум вдоль и поперёк, ничего схожего с моей задачей я не нашел. Если вы мне поможете со скриптом или поможете найти соответствующую тему, я буду очень благодарен. </p><p>Что мне нужно: </p><p>есть gui меню, где в edit я пишу путь к&nbsp; файлу n. Нужно сделать так, чтобы при нажатии на apply в gui, то, что я написал в edit, перенеслось в 	loop, read, %Text%.</p>]]></content>
			<author>
				<name><![CDATA[Mokson]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=41872</uri>
			</author>
			<updated>2021-12-07T17:11:49Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=151051#p151051</id>
		</entry>
</feed>
