<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Как Выбрать путь сохранения значений из GUI?]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=14453&amp;type=atom" />
	<updated>2018-12-28T19:38:03Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=14453</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как Выбрать путь сохранения значений из GUI?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=130689#p130689" />
			<content type="html"><![CDATA[<p><strong>inseption86</strong></p><p>Спасибо!<br />Я немного обновил код, добавив сохранение через проводник:</p><div class="codebox"><pre><code>#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 



Gui, +ToolWindow 
Gui, Add, Edit, vEdit r1 w100, %Val%
Gui, Add, Button,  w100 h30 gSave, Сохранить
Gui, Add, Button,  w100 h30 gLoad, Загрузить
Gui, Show,, *****
Return


Save:
GuiControlGet, Edit
FileSelectFile, FileName, S16,%A_Scriptdir%\Profile\, Сохранить профиль, *.txt
FileAppend, 
(
 %Edit%
), %FileName%.txt
return

Load:
FileSelectFile, SelectedFile,, %A_Scriptdir%, Открыть профиль:
FileRead, val, %SelectedFile%
GuiControl,, Edit, %val%
return



GuiClose:
ExitApp</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Clannad5]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39853</uri>
			</author>
			<updated>2018-12-28T19:38:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=130689#p130689</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как Выбрать путь сохранения значений из GUI?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=130679#p130679" />
			<content type="html"><![CDATA[<p>Если нужен современный апи с большими возможностями:<br /><a href="https://www.autohotkey.com/boards/viewtopic.php?t=53136">https://www.autohotkey.com/boards/viewtopic.php?t=53136</a></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-12-28T12:10:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=130679#p130679</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как Выбрать путь сохранения значений из GUI?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=130677#p130677" />
			<content type="html"><![CDATA[<p>Мой косяк, проявил невнимательность. Спасибо за подсказку.</p>]]></content>
			<author>
				<name><![CDATA[belyankin12]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34408</uri>
			</author>
			<updated>2018-12-28T11:54:46Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=130677#p130677</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как Выбрать путь сохранения значений из GUI?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=130676#p130676" />
			<content type="html"><![CDATA[<p><strong>Clannad5</strong></p><br /><div class="codebox"><pre><code>#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 



Gui, +ToolWindow 
Gui, Add, Edit, vEdit r1 w100, %Val%
Gui, Add, Button,  w100 h30 gSave, Сохранить
Gui, Add, Button,  w100 h30 gLoad, Загрузить
Gui, Show,, *****
Return


Save:
GuiControlGet, Edit
FileAppend, %Edit%, % A_Desktop &quot;\&quot; Edit &quot;.txt&quot;   
return


Load:
FileSelectFile, SelectedFile,, %A_Desktop%, Open a file:
FileRead, val, %SelectedFile%
GuiControl,, Edit, %val%
return



GuiClose:
ExitApp</code></pre></div>]]></content>
			<author>
				<name><![CDATA[inseption86]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38818</uri>
			</author>
			<updated>2018-12-28T11:35:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=130676#p130676</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как Выбрать путь сохранения значений из GUI?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=130674#p130674" />
			<content type="html"><![CDATA[<p>Попробуйте почитать справку. Уже существуют стандартные формы для чтения файла и сохранения файла.</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2018-12-28T11:00:28Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=130674#p130674</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как Выбрать путь сохранения значений из GUI?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=130673#p130673" />
			<content type="html"><![CDATA[<p><strong>belyankin12</strong></p><div class="codebox"><pre><code>#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 



Gui, +ToolWindow 
Gui, Add, Edit, r1 w100, ********
Gui, Add, Edit, r1 w100, ********
Gui, Add, Button,  w100 h30 gSave, Сохранить
Gui, Add, Button,  w100 h30 gLoad, Загрузить
Gui, Show,, *****
Return


Save:
FileSelectFile, FileName, S, %A_Desktop%, Create a new file:

if FileName !=
    MsgBox,  %FileName%
return




Load:
FileSelectFile, SelectedFile,, %A_Desktop%, Open a file:

if SelectedFile !=
    MsgBox, %SelectedFile%
return

GuiClose:
ExitApp</code></pre></div>]]></content>
			<author>
				<name><![CDATA[inseption86]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38818</uri>
			</author>
			<updated>2018-12-28T10:52:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=130673#p130673</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как Выбрать путь сохранения значений из GUI?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=130671#p130671" />
			<content type="html"><![CDATA[<p><strong>belyankin12</strong></p><p>Нашел в одном вики-примере этот код:</p><div class="codebox"><pre><code>; Example: This is a working script that writes some text to a file then reads it back into memory.
; It provides the same functionality as this DllCall-example.

FileSelectFile, FileName, S16,, Create a new file:
if (FileName = &quot;&quot;)
    return
file := FileOpen(FileName, &quot;w&quot;)
if !IsObject(file)
{
    MsgBox Can&#039;t open &quot;%FileName%&quot; for writing.
    return
}
TestString := &quot;This is a test string.`r`n&quot;  ; When writing a file this way, use `r`n rather than `n to start a new line.
file.Write(TestString)
file.Close()

; Now that the file was written, read its contents back into memory.
file := FileOpen(FileName, &quot;r-d&quot;) ; read the file (&quot;r&quot;), share all access except for delete (&quot;-d&quot;)
if !IsObject(file)
{
    MsgBox Can&#039;t open &quot;%FileName%&quot; for reading.
    return
}
CharsToRead := StrLen(TestString)
TestString := file.Read(CharsToRead)
file.Close()
MsgBox The following string was read from the file: %TestString%</code></pre></div><br /><p>Он открывает проводник для сохранения, но я точно не знаю что за что отвечает.</p><p>Вот ссылка на эту информацию:<br /><a href="https://autohotkey.com/docs/commands/FileOpen.htm">https://autohotkey.com/docs/commands/FileOpen.htm</a></p>]]></content>
			<author>
				<name><![CDATA[Clannad5]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39853</uri>
			</author>
			<updated>2018-12-28T09:19:51Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=130671#p130671</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как Выбрать путь сохранения значений из GUI?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=130670#p130670" />
			<content type="html"><![CDATA[<p>Как раз хотел создать подобную тему, ибо к сожалению ничего не нашел похожего. Мне необходимо вызвать окно &quot;Обзор&quot;, где я выбираю какой-либо файл или папку. Необходимо получить путь к выбранной папке, файлу. Прошу ваших советов.</p>]]></content>
			<author>
				<name><![CDATA[belyankin12]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34408</uri>
			</author>
			<updated>2018-12-28T07:49:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=130670#p130670</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Как Выбрать путь сохранения значений из GUI?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=130667#p130667" />
			<content type="html"><![CDATA[<p>Здравствуйте!</p><p>Имеется вопрос:</p><p>Возможно ли внутри AHK использовать проводник, для сохранения значений, которые я укажу в параметре?</p><br /><div class="codebox"><pre><code>Gui, Add, Edit, x46 y37 w240 h20 , %Val%</code></pre></div><p> </p><p>Есть цель:</p><p>Добавить несколько строк Edit и две кнопки &quot;Сохранить&quot; и &quot;Загрузить&quot;.</p><p>Нужно, чтобы при нажатие на кнопку GUI &quot;Сохранить&quot;, у меня открывался проводник, где я смогу выбрать путь до сохранения файла, аналогично с&nbsp; загрузкой файла, со всеми значениями %Val1% %Val2% и т.д, через Абзац.</p><p>Помогите, пожалуйста!</p>]]></content>
			<author>
				<name><![CDATA[Clannad5]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39853</uri>
			</author>
			<updated>2018-12-28T07:19:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=130667#p130667</id>
		</entry>
</feed>
