[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Action to save multiple gifs from selections

Posted on 2009-03-29
3
Medium Priority
?
437 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

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…
The Summer 2017 Scholarship Winners have been announced!
In this tutorial viewers will learn how to create a Photoshop action to apply adjustments and effects to multiple images. Open a photo for editing in Photoshop: Open the Actions window by going to Window > Actions: Start a new action by selecting th…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

656 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