Variable string als RAW text in text-file speichern Topic is solved

Stelle Fragen zur Programmierung mit Autohotkey

Moderator: jNizM

garry
Posts: 3763
Joined: 22 Dec 2013, 12:50

Variable string als RAW text in text-file speichern

22 Jan 2018, 06:21

mir fehlen wieder die Grundlagen ...
als Beispiel würde ich ein von einem ahk-script ein neues ahk-script erstellen , hier msgbox
-`n wird als ascii-code 10 gespeichert
-%a_scriptdir% als C:\.... ( fullpath von a_scriptdir )

Kann man im neu erstellten text-file die Variable 'string' genau gleich speichern wie im ersten file dargestellt ?
( so dass man als ahk-script starten kann )

Code: Select all

f1=%a_scriptdir%\variable_test.ahk
ifexist,%f1%
  filedelete,%f1%
ifnotexist,%f1%
{
string=
(Join`r`n
setworkingdir,%a_scriptdir%
msgbox, 262208,TEST ,This is a test`nSecondline
return
)
fileappend,%string%,%f1%,
}
run,notepad %f1%
return
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Variable string als RAW text in text-file speichern  Topic is solved

22 Jan 2018, 06:58

Code: Select all

#SingleInstance, Force
SetBatchLines -1

f1 := A_ScriptDir . "\variable_test.ahk"

F8::
   IfExist,% f1
      FileDelete,% f1
   IfNotExist,% f1
   FileAppend, 
      (LTrim Join`r`n % `
      SetWorkingDir,%a_scriptdir%
      MsgBox, 262208,TEST ,This is a test`nSecondline
      Return
      ),% f1
      Return

 F9::Run,% "notepad " f1
F10::Run,% f1
F12::Reload
F11::ExitApp
Funzt.
garry
Posts: 3763
Joined: 22 Dec 2013, 12:50

Re: Variable string als RAW text in text-file speichern

22 Jan 2018, 07:33

@BoBo , vielen Dank für die Lösung

Return to “Ich brauche Hilfe”

Who is online

Users browsing this forum: just me and 32 guests