Javascript command for taking a screenshot then saving it to a folder directory??

My question is basically what the title is, I’m new to Unity and learning Javascript. All help will be appreciated. for iOS platform

Funnily enough, if you’d searched for ‘screenshot’ in the unity scripting reference, this would have been the first hit. Use the API reference! It’s there to help you.

// The folder we place all screenshots inside.
// If the folder exists we will append numbers to create an empty folder.
var folder = “ScreenshotFolder”;

private var realFolder = "";

function OnGUI () {
  if (GUI.Button (Rect (10,10, 100, 50),"take screenshot")) {

function Start () {
   // Find a folder that doesn't exist yet by appending numbers!
   realFolder = folder;
   count = 1;
   while (System.IO.Directory.Exists(realFolder)) {
       realFolder = folder + count;
   // Create the folder

function captureScreen () {
   // name is "realFolder/0005 shot.png"
   var name = String.Format("{0}/{1:D04} shot.png", realFolder, Time.frameCount );

   // Capture the screenshot
   print("Screenshot taken");
Application.CaptureScreenshot (name);

I’m using this script to try and link up onGUI to capture screenshot function so that on the iOS images are saved to the photo library.

Hope this makes more sense as to my problem.

Yes we did manage to get it working siberman, jahroy is right that it implies native code,
great plugin worth investing in is prime 31 plugins as it does everything you need plus extra things too, there support is quick responce too.

Hope this helps.