# (OS X) Exported sketch looks for data folder in the wrong place

**URL:** https://discourse.processing.org/t/os-x-exported-sketch-looks-for-data-folder-in-the-wrong-place/16499
**Category:** Processing.py
**Created:** [December 19, 2019, 1:36am UTC](https://discourse.processing.org/t/os-x-exported-sketch-looks-for-data-folder-in-the-wrong-place/16499 "2019-12-19T01:36:22Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![pip](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/pip/32/7535_2.png) [@pip](https://discourse.processing.org/u/pip)
#### Post date: [December 19, 2019, 1:36am UTC](https://discourse.processing.org/t/os-x-exported-sketch-looks-for-data-folder-in-the-wrong-place/16499/1 "2019-12-19T01:36:22Z")

</div>

After exporting a python sketch, which needed a .png image file, the .app wouldn’t run.

After doing some testing, I realized the bug was that the sketch was looking for the .png file in “/Users/ME/”, instead of “/Users/ME/App.app/Contents/Processing/data/” (the path of the image).

And even after trying to use sketchPath, it still didn’t work since the sketchPath was “/Users/ME/”.

So here’s the question, how do I make the sketch in the .app register the data file in the correct path or at least somewhere inside the .app without me doing it manually?

Thanks!

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [December 22, 2019, 12:37am UTC](https://discourse.processing.org/t/os-x-exported-sketch-looks-for-data-folder-in-the-wrong-place/16499/2 "2019-12-22T00:37:25Z")

</div>

> [@pip](#):
>
> the sketchPath was “/Users/ME/”

That is strange.

Can you spell out the structure of your sketch?

Are you running building a sketch pyde file directly inside the users folder, using the user ME home as the sketch folder?

What happens if you create this sketch ~/Documents/PathTest/PathTest.pyde and run it?

```auto
def setup():
    size(600,360)
def draw():
    background(128)
    text(sketchPath(), 10, 20)

```

---

<div class="post-metadata">

### Author: ![pip](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/pip/32/7535_2.png) [@pip](https://discourse.processing.org/u/pip)
#### Post date: [December 22, 2019, 4:24pm UTC](https://discourse.processing.org/t/os-x-exported-sketch-looks-for-data-folder-in-the-wrong-place/16499/3 "2019-12-22T16:24:06Z")

</div>

I am building the sketch in ~/Documents/Processing/test/ ,  
and the other ones are built just in ~/Documents/Processing/name/ .  
In case 1, everything happened as predicted:

 ![Screenshot 2019-12-22 10.09.52](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/6/6aff846aaaf267659b7b6f094907172d472eb839.png)  
However, in case two, I got a different result!!!  
This time, it turns the sketch path into the base directory “/”!!!  
 ![Screenshot 2019-12-22 10.10.55](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/4/4b7eb84cd7f11c94d6ebfb7d35c2f789e8f15882.png)

UPDATE:  
I opened the .app file and went into test.app/Contents/MacOS/ and edited the unix executable, by removing the --exported on line 5.  
 ![Screenshot 2019-12-22 10.27.08](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/9/988d9ea96988811cda9908815e3cda4db09b1e3e.png)  
I got this:

 ![Screenshot 2019-12-22 10.36.37](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/9/9c410b22e5cc0663b3fcbb79310c687caf92f8e6.png)

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [December 22, 2019, 4:37pm UTC](https://discourse.processing.org/t/os-x-exported-sketch-looks-for-data-folder-in-the-wrong-place/16499/4 "2019-12-22T16:37:13Z")

</div>

So these are literally exactly the same sketch contents, with nothing else in the directory, and the literal folder names and file names are:

> /Users/ME/Documents/Processing/test/test.pyde  
> /Users/ME/Documents/Processing/name/name.pyde

is that correct? No other changes at all, and those are the exact paths/files?

---

<div class="post-metadata">

### Author: ![pip](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/pip/32/7535_2.png) [@pip](https://discourse.processing.org/u/pip)
#### Post date: [December 22, 2019, 4:40pm UTC](https://discourse.processing.org/t/os-x-exported-sketch-looks-for-data-folder-in-the-wrong-place/16499/5 "2019-12-22T16:40:52Z")

</div>

The other one is:

```auto
/Users/ME/Documents/Processing/Chess/Chess.pyde

```

“name” is a generalization for all the other sketches, as I use the same format.
