Screenshots not saved

Hi.

I’m trying to take a simple screenshot with simple code but can’t really understand why they aren’t saved.

if (key == 'a') {
    ofImage screenshot;
    screenshot.grabScreen(0, 0, ofGetWidth(), ofGetHeight());
    screenshot.save(ofGetTimestampString()+"_screenshot.png");
}

As far as I know they should now be saved into the data folder? Tried with “/”+ofGetTimestampString()+"_screenshot.png"); as well but not working either, the folder remains empty and tried to search with finder and couldn’t find any screenshots. What might be the reason?

Hi,
It works perfectly for me. I’m on windows though…
It would be good if you could provide all your specs so that we can find out what is the problem. OF version?

Os x yosemite, OF v.0.9.2. I wonder if it is something related to permissions, when I tried to change it to /newfolder/ it said in console that permission denied to create a new folder. So do I have to give OF/my app rights to write files on disc?

Thanks for reply :slight_smile:

Yes it could be a permissions issue. I don-t think you have to give your app any special rights. Just make sure your destination folder (and all the tree over your folder) is writable.