I am having a issue with Saving text to a fileselectfile

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Redpr0star
Posts: 8
Joined: 28 Jun 2017, 20:23

I am having a issue with Saving text to a fileselectfile

31 Jul 2017, 09:49

I think I could possibly use Gui, Submit no hide, though I'm not sure where to put it.
The main problem is that when they choose a file to save text to it makes the file but doesn't insert the text into it.

Code: Select all

Menu, FileMenu, Add, &Save`tCtrl+S, MenuFileSave
Menu, MyMenuBar, Add, &File, :FileMenu 
Gui, Menu, MyMenuBar
;This tells the gui to create a menu with file
Gui, Add, Edit, x192 y-1 w1160 h550 vCodev, Code
Gui, Add, Button, x-8 y-1 w100 h20 gSjas, Save to...
Gui, Add, Button, x92 y-1 w100 h20 , Open
Gui, Add, Picture, x2 y309 w190 h240 , Pictures\Groupbox.png
Gui, Add, Text, x62 y309 w100 h30 +BackgroundTrans, Add Property
Gui, Add, Picture, x2 y549 w320 h100 , Pictures\Groupbox.png
Gui, Add, Text, x72 y549 w100 h20 +BackgroundTrans, Options
Gui, Add, DropDownList, x12 y579 w100 h20 , DropDownList
Gui, Add, DropDownList, x142 y579 w100 h21 , DropDownList
Gui, Add, Edit, x322 y569 w1040 h80 vImpds , Current Langauge: Agel
Gui, Add, Text, x322 y549 w110 h20 vCond, Console
Gui, Add, Text, x12 y349 w50 h20 +BackgroundTrans, Character
Gui, Add, Button, x72 y349 w100 h20 , Add
Gui, Add, Text, x12 y389 w60 h20 +BackgroundTrans, Backround
Gui, Add, Button, x72 y389 w100 h20 , Add
Gui, Add, Text, x12 y429 w70 h20 +BackgroundTrans, Music/sound
Gui, Add, Button, x72 y429 w100 h20 , Add
Gui, Add, Button, x2 y59 w90 h20 , Live Game View
Gui, Add, Button, x92 y59 w100 h20 , Show helper
Gui, Add, Edit, x102 y29 w90 h20 , Open location
Gui, Add, Edit, x2 y29 w90 h20 vSjfs, Save location
Gui, Show, x415 y298 h653 w1367, RememEngine
Return

GuiClose:
ExitApp

Sjas:


MenuFileSave:
FileSelectFile, FileName, S16,, Save File, Game Managment Varibles (*.gmv)
Sleep, 2000
Gui, Font, cGreen
GuiControl, Font, Impds
GuiControl, , Impds, Saving File...
Goto, Saveji
return



Saveji:
Sleep, 3000
FileAppend, 
(
%Codev%
), %FileName%
GuiControl, , Impds, File saved!
return

Nightwolf85
Posts: 302
Joined: 05 Feb 2017, 00:03

Re: I am having a issue with Saving text to a fileselectfile

31 Jul 2017, 10:07

It doesn't look like you are submitting the GUI, so the variable Codev is probably Blank still.

Add Gui, Submit, NoHide either after MenuFileSave:, or Saveji:
User avatar
AlphaBravo
Posts: 586
Joined: 29 Sep 2013, 22:59

Re: I am having a issue with Saving text to a fileselectfile

31 Jul 2017, 10:09

Yes, add Gui, Submit, nohide any where here after "MenuFileSave:" and before fileappend

Code: Select all

Sjas:
MenuFileSave:
FileSelectFile, FileName, S16,, Save File, Game Managment Varibles (*.gmv)
Sleep, 2000
Gui, Font, cGreen
GuiControl, Font, Impds
GuiControl, , Impds, Saving File...
Goto, Saveji
return

Saveji:
Sleep, 3000
FileAppend, 
(
%Codev%
), %FileName%
GuiControl, , Impds, File saved!
return
FYI the goto below is redundant.

Code: Select all

Goto, Saveji
return

Saveji:
Redpr0star
Posts: 8
Joined: 28 Jun 2017, 20:23

Re: I am having a issue with Saving text to a fileselectfile

31 Jul 2017, 10:24

Thanks guys, I put Gui nohide before file append and it works perfectly

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot] and 121 guests