?
Solved

Action to save multiple gifs from selections

Posted on 2009-03-29
3
Medium Priority
?
436 Views
Last Modified: 2012-05-06
I am looking to select and save gif files from within a document. I need an action that will allow me to create a selection (marque) and the save out that selection as a gif (save for web). The ones I have created wont change the name and therefore overwrites the preceding saved gif.
sample.jpg
0
Comment
Question by:patGRFXS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 12

Accepted Solution

by:
alien109 earned 1000 total points
ID: 24014495
I tend to lean towards javascript, rather than ps actions for this sort of stuff. If you save the following script to your drive as saveGif.js

/* start */
function exportGif(doc)
{
      saveFile = new File("c:/" + doc.name + ".gif");
      saveOptions = new GIFSaveOptions();
      saveOptions.palette = Palette.LOCALADAPTIVE;
      saveOptions.colors = 128;
      saveOptions.transparency = true;
      saveOptions.matte = MatteType.WHITE;
      doc.saveAs(saveFile, saveOptions, true, Extension.LOWERCASE);
}

var w = app.activeDocument.selection.bounds[2] - app.activeDocument.selection.bounds[0];
var h = app.activeDocument.selection.bounds[3] - app.activeDocument.selection.bounds[1];

app.activeDocument.selection.copy(true);
var newDocumentRef = app.documents.add(w, h, 72.0, prompt("filename?"));
newDocumentRef.paste();
newDocumentRef.flatten();

exportGif(newDocumentRef);
newDocumentRef.close(SaveOptions.DONOTSAVECHANGES);
/* end */

Then create an action in photoshop to run the script: Start record -> File -> Scripts -> Browse and select the saveGif.js script. Assign the action a hotkey, like CTRL f12.

Then make a selection in your document. Press F12. You will be prompted for a filename. Type it in, and blammo.

Note - you might want to change where the image gets saved to by changing the line:

saveFile = new File("c:/" + doc.name + ".gif");

At the moment, it just saves to the root of your C drive.
0
 
LVL 12

Assisted Solution

by:Tony van Schaik
Tony van Schaik earned 1000 total points
ID: 24214316
Wouldn't it be easier to use use slices instead of Actions to Save for web. But i depends what you are trying to do? Images from PDF? Or just PSD.
I'm using slices for something like this: http://www.j-learning.org/present_it/page/using_photoshop_slices/
 
 
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

HOW TO CREATE A WEB 2.0 IMAGE WITH A REFLECTION I would like to start by saying I know Web 2.0 isn't a style. It is actually the practice of information sharing or  collaboration on the Web. It is also associated with the technology that is used …
Introduction When sharing photos, especially via e-mail, the large resolution images that most cameras take today make for extremely large file sizes. The time required to upload these files to forums, send in e-mails, post to blogs or even placi…
In this tutorial viewers will learn how to restore old photos in Photoshop (an introduction to the Clone tool) Zoom into a damaged area: Click on the "Stamp" icon to use the Clone tool. Hold the Alt key and click to select a region. Click again, and…
In this tutorial viewers will learn how to create a vector texture to apply a non-rasterized texture to vector images, using Photoshop and Illustrator Open a textured image such as a scanned-in piece of cardboard in Photoshop: Convert the texture to…
Suggested Courses
Course of the Month8 days, 6 hours left to enroll

766 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question