Windows Creating a txt file to the desktop of your computer

W

White_heart_of_Blood

Guest
I have been thinking of a game where the game creates a file on your computer but I have no clue how to set it up. I know the code to create a txt with a ds_map and file_text_open. But dont know how to make it go to the desktop of a computer.
Here is the code for the creating txt file:
Code:
help = "Something";
word = ds_map_create()

word[? "Run"] = help;

var word_string = json_encode(word);
ds_map_destroy(word);

var file = file_text_open_write(working_directory + "READ ME.txt");
file_text_write_string(file, word_string);
file_text_close(file);

show_message('Goto C:\Users\Pc name\AppData\Local\Test_my_Game_idea');
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
Thanks and also I got the copy files in/out of sandbox but how can I use it for txt files?
You'd create a file in appdata directory and use the extension to copy it to the desktop. environment_get_variable can be used to help resolving the absolute path to the desktop.
 
W

White_heart_of_Blood

Guest
You'd create a file in appdata directory and use the extension to copy it to the desktop. environment_get_variable can be used to help resolving the absolute path to the desktop.
Thxs u really r helpful
 
V

Vinicius Alvarenga

Guest
You'd create a file in appdata directory and use the extension to copy it to the desktop. environment_get_variable can be used to help resolving the absolute path to the desktop.
Where do i exactly create the file?
 
Top