# Save String to .txt file when the program is a standalone application

**URL:** https://discourse.processing.org/t/save-string-to-txt-file-when-the-program-is-a-standalone-application/26898
**Category:** Coding Questions
**Created:** [January 8, 2021, 8:48pm UTC](https://discourse.processing.org/t/save-string-to-txt-file-when-the-program-is-a-standalone-application/26898 "2021-01-08T20:48:28Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![THWU0412](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@THWU0412](https://discourse.processing.org/u/THWU0412)
#### Post date: [January 8, 2021, 8:48pm UTC](https://discourse.processing.org/t/save-string-to-txt-file-when-the-program-is-a-standalone-application/26898/1 "2021-01-08T20:48:28Z")

</div>

My program loads a .txt file via the `loadStrings()` command.  
Then it creates a new String and saves it to the .txt file via the `saveStrings()` command.  
My problem is that when i create a standalone application it creates a new folder with the .txt file in it.  
How can i create the application and save data in it?

FYI: It’s for the highscore in a game I’m programming.

 ![Bildschirmfoto 2021-01-08 um 21.46.29](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/5/530a5890cd2c7a156986fad243bb2057f713c449.png)

---

<div class="post-metadata">

### Author: ![ErraticGenerator](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/erraticgenerator/32/11304_2.png) [@ErraticGenerator](https://discourse.processing.org/u/ErraticGenerator)
#### Post date: [January 9, 2021, 10:02pm UTC](https://discourse.processing.org/t/save-string-to-txt-file-when-the-program-is-a-standalone-application/26898/2 "2021-01-09T22:02:19Z")

</div>

I don’t think you can save the file as part of your application package. (Please correct me if I’m wrong.)

You can instead check if the file exists at program startup and either create a new one or load an existing one and use the data in your app.

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [January 10, 2021, 10:53am UTC](https://discourse.processing.org/t/save-string-to-txt-file-when-the-program-is-a-standalone-application/26898/3 "2021-01-10T10:53:16Z")

</div>

> [@THWU0412](#):
>
> Then it creates a new String and saves it to the .txt file via the `saveStrings()` command.

you probably should always save in the data folder

probably the standalone app does save in the data folder and the app in the IDE doesn’t

---

<div class="post-metadata">

### Author: ![abatllei](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@abatllei](https://discourse.processing.org/u/abatllei)
#### Post date: [June 3, 2021, 5:40pm UTC](https://discourse.processing.org/t/save-string-to-txt-file-when-the-program-is-a-standalone-application/26898/4 "2021-06-03T17:40:20Z")

</div>

I have the same problem! Did you find the solution?

---

<div class="post-metadata">

### Author: ![THWU0412](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@THWU0412](https://discourse.processing.org/u/THWU0412)
#### Post date: [June 3, 2021, 7:34pm UTC](https://discourse.processing.org/t/save-string-to-txt-file-when-the-program-is-a-standalone-application/26898/5 "2021-06-03T19:34:29Z")

</div>

Sorry. Unfortunately not

---

<div class="post-metadata">

### Author: ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)
#### Post date: [June 3, 2021, 11:15pm UTC](https://discourse.processing.org/t/save-string-to-txt-file-when-the-program-is-a-standalone-application/26898/7 "2021-06-03T23:15:08Z")

</div>

If you look in the galery section ive added a filewriter reader in that section. Itll write and read any file in almost any location
