Pakistan IT Forum (Discuss Information Technology in Pakistan)
News: Pakistan Budget 2007 Highlights - Click Here
 
*
Hi, Guest. Welcome to IT Forum of Pakistan, Please login or register. January 07, 2009, 02:36:37 AM


Login with IT Forum's username, password and session length


Pak IT forum is launched to provide Pakistan's IT community with a platform to discuss IT related issues. These IT related discussions are proved to be useful for other Pakistani people. Information Technology in Pakistan is hottest issue on IT related forums. We hope that serious Pakistani people will join this IT Forum and will let us know about their experience in order to boast Pakistan's Software Exports.

Pages: [1]
  Print  
Author Topic: Saving files within Action/Bathches to multiple folders  (Read 694 times)
vajiha
Newbie
*
Posts: 29


View Profile Email
« on: May 28, 2007, 01:05:17 PM »

I'm trying to convert images from GIF to JPG.

The thousands GIF files reside in multiple sub-folders. I would like the converted JPGs to be saved in the same folder as the GIF file it originated from.

I've created an action and ran it through the batch process. The files converted to JPG OK, but all the converted files end up saving in one single folder instead of the folders they originated from.

Below is the action I created. I know that the action lists a specific folder to save in and that is why the files all save there, but I don't know how else to record the action "save to web" without selecting the save option.
 
Action: GIF2JPG
        Export
            Using: Save For Web
            Operation: Save
            Format: JPEG
            Without Interlaced
            Quality: 60
            0
            Quality Modification Channel Strength: 0
            Without Quality Channel Text Layers
            Without Quality Channel Vector Layers
            With Optimized
            Number Of Passes: 1
            Blur: 0
            Without Embed ICC Profile
            With Matte
            Matte Color Red: 255
            Matte Color Green: 255
            Matte Color Blue: 255
            Without Save HTML File
            With Save Image Files
            false
            none
            true
            In: C:\images\folder1
        Close
            Saving: no

When running the action through the batch process I've selected "None" and "Save & Close" within the destination options. Neither worked.

I saw a save file sript that someone provided within this Photoshop forum, but I don't know what to do with that script.

Please advise.
Logged
rashid
Newbie
*
Posts: 27


View Profile Email
« Reply #1 on: May 28, 2007, 01:11:12 PM »

It would be useful to know what vertion of Photoshop you are using.
If you are using PSCS2 PSCS3 the following code would do a whole directory of GIFs.
save the code to a file with a jsx extention to your scripts folder ie:- Gif2Jpg.jsx
pscs2
C:\Program Files\Adobe\Adobe Photoshop CS2\Presets\Scripts
pscs3
C:\Program Files\Adobe\Adobe Photoshop CS3\Presets\Scripts
To run the script Open Photoshop then
File - Scripts - Gif2Jpg

//Save all GIF files in selected folder as Save For Web jpg files.

var imageFolder = Folder.selectDialog("Select the folder with GIFs to process");
Quote
if (imageFolder != null)
{
   var fileList = imageFolder.getFiles("*.gif")
   for (var i = 0; i < fileList.length; i++)
   {
   
      if (fileList instanceof File)
      {
         open(fileList);         
 var doc = app.activeDocument;
var docName = app.activeDocument.name.slice(0,-4) + ".jpg";
SaveForWeb(doc.path + "/" + docName),
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
      }
   }
}

function SaveForWeb(JpgFile) {
var sfwOptions = new ExportOptionsSaveForWeb();
   sfwOptions.format = SaveDocumentType.JPEG;
   sfwOptions.includeProfile = false;
   sfwOptions.interlaced = 0;
   sfwOptions.optimized = true;
   sfwOptions.quality = 60; //0-100
   doc.flatten();
doc.exportDocument(new File(JpgFile), ExportType.SAVEFORWEB, sfwOptions);
}
Logged
Pages: [1]
  Print  
 
Jump to:  


Powered By: comsdev Partners