Script for using layer name in Save for Web command

I am using the Save for Web  command (Illustrator CS2) to export layers to CSS so that each layer is  saved as a different jpg.  The only issue I have is that I want the  layer name to be part of the file name, but layer name is not an option  when I look at the "Edit Output settings" dialog for saving files.  Is  there anyway I can do this? I do not have experience writing or working with scripts.
For example. My fiel name is flower.ai.  I will have 20  different layers (each containing a different color of the same image)  and want the exported file to be flower-scarlet.jpg,  flower-cranberry,jpg, etc. Right now I am looking at renaming all the  files manually, but as I am creating 40 images per product on my website, this will be very time consuming.
Thanks in advance
Christine

Btw.. to make it work for JPGs, change the PNG options to the following:
var options = new ExportOptionsJPEG();
        options.antiAliasing = false;
        options.optimization = false;
        options.artBoardClipping = true;
        options.qualitySetting = 100; // value of 0 to 100, 60 is medium, 100 is perfect
        options.blurAmount = 0;
        options.verticalScale = 100;
        options.horizontalScale = 100;

Similar Messages

  • Problem for using oracle xml parser v2 for 8.1.7

    My first posting was messed up. This is re-posting the same question.
    Problem for using oracle xml parser v2 for 8.1.7
    I have a sylesheet with
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">.
    It works fine if I refer this xsl file in xml file as follows:
    <?xml-stylesheet type="text/xsl" href="http://...../GN.xsl"?>.
    When I use this xsl in pl/sql package, I got
    ORA-20100: Error occurred while processing: XSL-1009: Attribute 'xsl:version' not found in 'xsl:stylesheet'.
    After I changed name space definition to
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> in xsl file, I got
    ORA-20100: Error occurred while processing: XSL-1019: Expected ']' instead of '$'.
    I am using xml parser v2 for 8.1.7
    Can anyone explain why it happens? What is the solution?
    Yi

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Steven Muench ([email protected]):
    Element's dont have text content, they [b]contain text node children.
    So instead of trying to setNodeValue() on the element, construct a Text node and use the appendChild method on the element to append the text node as a child of the element.<HR></BLOCKQUOTE>
    Steve,
    We are also creating an XML DOM from java and are having trouble getting the tags created as we want. When we use XMLText it creates the tag as <tagName/>value rather than <tagName>value</tagName>. We want separate open and close tags. Any ideas?
    Lori

  • Is there a script for changing layer names in ID CS4?

    I have multiple documents with an average of 20 layers in each. Each of the layers is named for the expiration date of the coupon in the ads. When a new order comes in I retrieve the previous files and change the dates via scripts and the Find/Change option. I have looked but cannot find a way to rename the dates in the layers as well.
    Does anyone know of a script for this?
    Thanks in advance!

    E-mail, eh? You're missing out a lot of fun stuff, as there is
    - editing your own posts
    - using bold and italics to highlight important stuff
    - finally being able to shout (some posters think it's necessary to use a large bold font to make their post stand out in the crowd. They are correct, it does. In the Bad way.)
    - inserting images
    - uh, Jive (-- sorry, couldn't think of any more fun stuff to add)
    Visit the scripting forum (using a web browser, s'il vous plait) by clicking here.

  • Adding suffix to jpg file name? Save for web?

    Hi,
    I'm very new to Applescript but, with the help of a few others (thanks H), I've managed to successfully write a script to produce various versions of a selected set of photos. However what I would also like to be able to do is to add a suffix of the letter "w" to all the photos which end up in my Webpics folder and the letter "t" to those which end up in the Webthumbs folder. i.e. abc.jpb becomes abcw.jpg and then abcwt.jpg.
    I'm sure this isn't hard but I've had a good look through various forums and tried loads of different things and still seem to be failing. If anyone can help I'd be hugely grateful. My script is below.
    Also, does anyone know if it is possible incorporate a script for Photoshop / ImageReady which does the "save for web" thing? i.e. so that the photos in the webpics/webthumbs folders have been saved for web. At the moment I use an ImageReady droplet which does the job but I'd love to be able to script it in.
    Many thanks, Eddy
    set original_folder to (choose folder with prompt "Choose Folder containing the files")
    tell application "Finder"
    if not (exists folder "Webpics" of original_folder) then make new folder at original_folder with properties {name:"Webpics"}
    if not (exists folder "Webthumbs" of original_folder) then make new folder at original_folder with properties {name:"Webthumbs"}
    set copies_folder to folder "Webpics" of original_folder
    set copies2_folder to folder "Webthumbs" of original_folder
    duplicate every file of original_folder to copies_folder
    set the_files to every file of copies_folder
    repeat with each_file in the_files
    set each_file to each_file as alias
    my dophotoshop_stuff_to(eachfile)
    end repeat
    duplicate every file of copies_folder to copies2_folder
    set webthumbs_folder to folder "Webthumbs" of original_folder
    set the_files to every file of webthumbs_folder
    repeat with each_file in the_files
    set each_file to each_file as alias
    my dophotoshop_stuff2_to(eachfile)
    end repeat
    end tell
    on dophotoshop_stuff_to(thisfile)
    tell application "Adobe Photoshop CS"
    open this_file
    do action "Masterpic to Webpic" from "Set 1.atn"
    close current document saving yes
    end tell
    end dophotoshop_stuffto
    on dophotoshop_stuff2_to(thisfile)
    tell application "Adobe Photoshop CS"
    open this_file
    do action "Webpic to Webthumb" from "Set 1.atn"
    close current document saving yes
    end tell
    end dophotoshop_stuff2to
      Mac OS X (10.4.4)  

    Ok, here is your script, not tested, but seems like it should work. The idea of shortening this script is that instead of duplicating files (simpler but longer, and you may face a timeout if there are a lot of files), you can pass the original file along to your script, that'll resize it and save the new version in folder 1, then resize it again and save the newer version in folder 2.
    Make a copy of the original files before you start testing
    Rookie Developer Hint : Slip in a display dialog followed by a return when testing to check the intermediate output.
    Return stops your script where you slip it.
    set original_folder to (choose folder with prompt "Choose Folder containing the files")
    tell application "Finder"
    if not (exists folder "Webpics" of original_folder) then make new folder at original_folder with properties {name:"Webpics"}
    if not (exists folder "Webthumbs" of original_folder) then make new folder at original_folder with properties {name:"Webthumbs"}
    set Webpics_folder to folder "Webpics" of original_folder
    set Webpics_path to ((original_folder as text) & "Webpics") as string
    set webthumbs_folder to folder "Webthumbs" of original_folder
    set webthumbs_path to ((original_folder as text) & "Webthumbs") as string
    set the_files to every file of original_folder
    repeat with each_file in the_files
    set file_name to (items 1 thru -5 of (name of each_file as text))
    set each_file to each_file as alias
    display dialog "Full path to the file: " & (each_file as text) & return & return & "Short name: " & file_name
    set each_file to each_file as alias
    set WebpicTarget to (Webpics_path & file_name & "W") as string
    my dophotoshop_stuff_to(eachfile, WebpicTarget)
    set webthumbsTarget to (webthumbs_path & file_name & "T") as string
    my dophotoshop_stuff2_to(eachfile, webthumbsTarget)
    end repeat
    end tell
    on dophotoshop_stuff_to(thisfile, saveTarget)
    tell application "Adobe Photoshop CS2"
    open this_file
    do action "Masterpic to Webpic" from "Set 1.atn"
    save this_file in saveTarget
    close current document --saving yes
    end tell
    end dophotoshop_stuffto
    on dophotoshop_stuff2_to(thisfile, saveTarget)
    tell application "Adobe Photoshop CS2"
    open this_file
    do action "Webpic to Webthumb" from "Set 1.atn"
    save this_file in saveTarget
    close current document --saving yes
    end tell
    end dophotoshop_stuff2to
    HTH
    J.

  • Using QuickTime Player's 'Save for Web' feature in iWeb

    I'm using iWeb (3.0.3) to create a site. I've also used the QuickTime Player (10) feature "Save for Web" command to save optimized versions (for iPhone and desktop) of a clip I'm using in my site. I want to keep the nice features of the QT Save for Web, i.e., the poster frame and the nicer QT controller.
    I've managed to get everything hooked up right (using an HTML snippet in iWeb and hand-editing the page's html file to add the lines to <head> that the Save for Web's instructions specify. Yay!
    All good so far. When I view the page in Safari, the poster frame shows up perfectly. But when I click on it, Safari swaps in a new page (frameset?), which loses all the navigational stuff I have on the "real" page. The Save for Web's instruction html page doesn't do this -- why is it happening in the iWeb page? I've tried stripping stuff out of the iWeb-generated page, but no luck.
    Please help ... I've spent HOURS trying to figure this out, and I'm at my wit's end!! 
    (Additionally, if someone can tell me where I can put the 4 files that the Save for Web command creates so that iWeb doesn't wipe them everytime I publish, I would be a very happy man!! 

    This demo page has instructions on how to use that feature: #18 - Adding Movie/Video File to iWeb Page via Export for Web in Quicktime Player. 
    This demo page has an example of how it looks: Using a Movie Exported Out of Quicktime Player via “Export for Web”
    OT

  • Bold option, at least for main layer names

    I realize it may not be simple, but it would be so helpful in complex docs with many layers and sublayers to have the option of putting some in bold, especially the top/main layers. I have over 250 layers in a complex map doc, all sorted in sublayers with styles, etc., but when I open a layer (even with a 30" screen) it becomes a challenge to find my place. A simple bold main layer would really help.

    I can agree with this. I will add to this the suggestion to color entire layer names rather than just the tiny colored area we get now.

  • Putting fileinfo data on bottom of image for use in building a photobook for printing/binding

    I wonder if someone on here could help me with a problem I have? I am not a script expert by any means. The term "amateur" is probably pretty accurate!
    I have a few hundred pictures I want to include into a (to be printed) photobook. I want to put some key EXIF/Fileinfo data on the images so that they remind me of what file, when it was taken, with what and with what settings. I found an excellent script (by JJmack?) which does what i want with one exception. The script (below) puts the info on the image starting on the top left (0,0) and I really want it to start on the bottom left (so that it looks like a caption). I have tweaked the original 5 lines of data down to one line, and have reduced the font size but I simply do not have the skills to amend it to add the selected text to the bottom left.
    I was hoping that someone on this forum might be kind enough to help - not least because I am sure there are others who would want to the same thing? Or am I being a complete idiot and there is a simpler way to achieve what I am trying to do?
    Grateful for any help
    Michael.
    Apologies - can't find way to insert file so had to copy and paste:
    // This script was hacked from one I downloaded from the web JJMack 2008
    /*  Script to stamp copyright and camera data of shot   */
    // This script is supplied as is. It is provided as freeware.
    // The author accepts no liability for any problems arising from its use.
    <javascriptresource>
    <about>$$$/JavaScripts/StampExif/About=JJMack's Stamp Exif.^r^rCopyright 2009 Mouseprints.^r^rScript utility for action.^rNOTE:Add Text Layer with Fomatted EXIF Data!</about>
    <category>JJMack's Action Utility</category>
    </javascriptresource>
    // enable double-clicking from Mac Finder or Windows Explorer
    #target photoshop // this command only works in Photoshop CS2 and higher
    // bring application forward for double-click events
    app.bringToFront();
    // ensure at least one document open
    if (!documents.length) {
        alert('There are no documents open.', 'No Document');
    // if at least one document exists, then proceed
    else {
        main();
    // main - main function
    function main() {
        /* Null business owner */
        var Biz = "";
        var Owner = "";
        /* Variables You can hard code your business owner here */
        // var Biz = "Mouseprints";
        // var Owner = "John J McAssey";
            /*  sizeFactor influences text size 1 will use largest font 2 will half that font size    */
        var sizeFactor = 1.5;
            /* textX and TextY positions text placement 0 and 0 Top Left corner of image in pixels    */
        var textX = 0;                                   
        var textY = 0;   
        /* Internal Photoshop Text name                                */                               
            var fontName = "ArialMT";
        var fontName = "TimesNewRomanPSMT";
        var fontName = "Tahoma";
        /* Text Color                                        */
        textColor = new SolidColor;                       
        textColor.rgb.red = 255;
        textColor.rgb.green = 255;
        textColor.rgb.blue = 255;
        /* END Variables You can hard code your business owner here */
            // remember users Ruler avd Type Units and set ours
        var strtRulerUnits = app.preferences.rulerUnits;
        var strtTypeUnits = app.preferences.typeUnits;
        app.preferences.rulerUnits = Units.PIXELS;
         app.preferences.typeUnits = TypeUnits.PIXELS;
        /* Trying to figure out font size for the number of lines to cover the document height        */
        /* and getting setting text area to cover the document was a trip. Adobe Postscript trip    */
        /* I believe that 72 or 72.27 Point/Pica Size Photoshop Preference maybe I should see if    */
        /* I could retrieve it. Anyway mine is set to 72 Setting the document resolution taking        */
        /* the document width and dividing by 72 would probably yield number of characters that        */
        /* would fit in the document width. Setting the documents resolution comes into play        */
        /* with Photoshop text support. Using the documents height and dividing the by the number    */
        /* of lines of text I needed I hoped would yield the font size I needed. However that        */
        /* did not work the text area was correct the number of text lines did not fit. I needed    */
        /* to use a smaller font.  When the document resolution is set to 72 DPI and I set a text    */
        /* layer font size to 72 and the text area the number of pixels I want and observing        */
        /* Photoshop's text options bar there I see a one 1 to one relationship. 72 px = 72 px.        */
        /* If I set the documents resolution lower and set a Photoshop text layer font size to        */
        /* 72 px I see Photoshop scale the number to a lower number of pixels in the option bar.    */
        /* Just what I needed. Setting the Documents resolution to 60 DPI let the number of line    */
        /* I needed fit on the document. However Photoshop also scaled the text area I set down        */
        /* in size and that number of lines did not fit within that area. I needed to scale the        */
        /* text area up. Scaling the Text area up using 72/resolution did the trick...             */
            var testres = 60;
        res = app.activeDocument.resolution;
        if(res!=testres){ app.activeDocument.resizeImage(app.activeDocument.width.value,app.activeDocument.height.v alue,testres); }
        /* Define var to be used to avoid undefined */
        var expTime = "";
        var expPgm = "";
        var expCmp = "";
        var mtrMode = "";
        var ev = "";
        var flshCode = "";
        var flshMode = "";
        var focLength = "";
        var Fstop = "";
        var ISO = "";
        var Model = "";
        var CameraModel = "";
        var Artist = "";
        var maxF = "";
        var wbMode = "";
        var phoTime = "";
        var picYr = "";
        var lens = "";
        var cpyrt = "";
        var remShutter = "";
        var remAperture = "";
        var remISO = "";
        var lat = "";
        var latRef = "";
        var lon = "";
        var lonRef = "";
        var docName = app.activeDocument.name;
        /* END var to be used to avoid undefined */
        try {   // get active document
            var doc = app.activeDocument;
        catch (e){
            alert("No Document Open..." );
        var exifInfo = "";
    try {
            // alert( "doc.info.exif=" + doc.info.exif );
            var numExifItems = doc.info.exif.length;
            // alert( "numExifItems=" + numExifItems );
                    for (var i = 0; i < doc.info.exif.length; i++){
                 exifInfo = exifInfo + doc.info.exif[i][0] + " = " + doc.info.exif[i][1] + "\r";
    /* ---------------------------------- Extracting Data I want to Stamp  formated ----------------------------------------------------------------------- */
                            checkThisItem(doc.info.exif[i][0], doc.info.exif[i][1])
                key=doc.info.exif[i][0];
                keyData=doc.info.exif[i][1];
                if (key == "Artist") {
                    // alert ("Key=" + key + " Data=" + keyData );
                    Artist =("By " + keyData + "  ");
                 if (key == "Date Time Original") {
                    // alert ("Key=" + key + " Data=" + keyData );
                    var phoTime = keyData;
                    var dateArray1 = phoTime.split(" ", 2);
                    phoTime = dateArray1[0];
                    phoHour = dateArray1[1];
                    var dateArray2 = phoTime.split(":");
                    var monthsArray = ["January","February","March","April","May","June","July","August","September","October", "November","December"];
                    phoTime = monthsArray[dateArray2[1]-1]+" " + dateArray2[2]+ ", " + dateArray2[0] +" @ " + phoHour;
                    var picYr = dateArray2[0];
                if (key == "Model") {
                    // alert ("Key=" + key + " Data=" + keyData );
                    Model = (keyData + "  ");
                if (key == "Max Aperture Value") {
                    // alert ("Key=" + key + " Data=" + keyData );
                    maxF = ("maxF " + keyData + " ");
                    maxF = ( keyData + " ");
                if (key == "Focal Length") {
                    // alert ("Key=" + key + " Data=" + keyData );
                    focLength = ("@ " +keyData + "  ");
                if (key == "Exposure Program") {
                    // alert ("Key=" + key + " Data=" + keyData );
                    expPgm = (keyData + "  ");
                    if (expPgm == "Not defined") { expPgm = "Exposure Program Not Recorded  "; }
                if (key == "Exposure Bias Value") {
                    // alert ("Key=" + key + " Data=" + keyData );
                    expCmp = ("Bias " + keyData + "  ");
                if (key == "Metering Mode") {
                    //alert ("Key=" + key + " Data=" + keyData );
                    mtrMode = (keyData + " Metering  ");
                if (key == "White Balance") {
                    // alert ("Key=" + key + " Data=" + keyData );
                    wbMode = ("White Balance " + keyData + "  ");
                if (key == "ISO Speed Ratings") {
                    // alert ("Key=" + key + " Data=" + keyData );
                    ISO = ("ISO " + keyData + "  ");
                    remISO = keyData;
                if (key == "Exposure Time") {
                    // alert ("Key=" + key + " Data=" + keyData );
                    expTime = (" " + keyData + "  ");
                    remShutter = keyData;
                if (key == "F-Stop") {
                    //alert ("Key=" + key + " Data=" + keyData );
                    Fstop = (" " + keyData + "  ");
                    remAperture = keyData;
                if (key == "Flash") {
                    // alert ("Key=" + key + " Data=" + keyData );
                    var flshCode = keyData;
                    var flshMode = "Flash Code=" + flshCode + "  ";
                    if(flshCode==1){var flshMode = "Firing Flash   ";}
                    if(flshCode==9){var flshMode = "Firing Flash   ";}
                    if(flshCode==13){var flshMode = "Firing Flash   ";}
                    if(flshCode==15){var flshMode = "Firing Flash   ";}
                    if(flshCode==25){var flshMode = "Firing Flash   ";}
                    if(flshCode==29){var flshMode = "Firing Flash   ";}
                    if(flshCode==31){var flshMode = "Firing Flash   ";}
                    if(flshCode==65){var flshMode = "Firing Flash   ";}
                    if(flshCode==69){var flshMode = "Firing Flash   ";}
                    if(flshCode==71){var flshMode = "Firing Flash   ";}
                    if(flshCode==73){var flshMode = "Firing Flash   ";}
                    if(flshCode==77){var flshMode = "Firing Flash   ";}
                    if(flshCode==79){var flshMode = "Firing Flash   ";}
                    if(flshCode==89){var flshMode = "Firing Flash   ";}
                    if(flshCode==93){var flshMode = "Firing Flash   ";}
                    if(flshCode==95){var flshMode = "Firing Flash   ";}
                    if(flshCode==0){var flshMode = "without Flash   ";}
                    if(flshCode==16){var flshMode = "without Flash   ";}
                    if(flshCode==24){var flshMode = "without Flash   ";}
                    if(flshCode==88){var flshMode = "without Flash   ";}
                    if(flshCode==32){var flshMode = "No Flash   ";}
                if (key == "GPS Latitude") {
                    //alert ("Key=" + key + " Data=" + keyData );
                    lat= ("Lat: " + keyData.replace(/\.00/g,'') + " ");
                if (key == "GPS Latitude Ref") {
                    //alert ("Key=" + key + " Data=" + keyData );
                    latRef= (keyData + "  ");
                if (key == "GPS Longitude") {
                    //alert ("Key=" + key + " Data=" + keyData );
                    lon= ("Lon: " + keyData.replace(/\.00/g,'') + " ");
                if (key == "GPS Longitude Ref") {
                    //alert ("Key=" + key + " Data=" + keyData );
                    lonRef= (lon + keyData + "  ");
            /* Copyright Year(s) */
            var thisYr, toDay       
            var toDay = new Date();
            var thisYr = toDay.getYear() + 1900;
            if(picYr!="" && thisYr!=""){ var cpyrt =  picYr + "-" + thisYr + "  ";}
            if(picYr=="" && thisYr!=""){ var cpyrt =  thisYr + "  ";}
            if(picYr==thisYr){ var cpyrt =  thisYr + "  ";}
            /* For cameras that don't set Artist or set unknown in the Exif substitute Owner if set */
            if(Artist=="" && Owner!=""){var Artist = "By  " + Owner + "   ";}
            if(Artist=="By unknown  " && Owner!=""){var Artist = "By  " + Owner + "   ";}
            /*  Lens info  */
            xml = app.activeDocument.xmpMetadata.rawData;
            lensOffset = xml.indexOf("<aux:Lens>") + "<aux:Lens>".length;
            if(lensOffset > 0) {
                lens = xml.substr(lensOffset, xml.length - lensOffset);
                lens = lens.substr(0,lens.indexOf("</aux:Lens>"));
            /* Hack for my cameras with fixed lens */
            if(lens=="" && Model=="E990  "){var lens = "9-28mm";}
            if(lens=="" && Model=="E-20,E-20N,E-20P  "){var lens = "9-36mm";}
            if(lens=="" && Model=="E-10  "){var lens = "9-36mm";}
            if(lens=="" && Model=="E-10          "){
                var Model = "E-10  ";
                var lens = "9-36mm";
            if(lens=="" && Model=="Canon PowerShot SD700 IS  "){var lens = "5.8-23.2mm";}
            if(lens!=""){var lens = lens + "  ";}
            else {var lens = "Unknown Lens  ";}
            /* Hack for my ultra compact cameras program mode not recorded */
            if(Model=="Canon PowerShot SD700 IS  "){var expPgm = "Ultra Compact Camera  ";}
            //alert (remShutter + " " + remAperture + " " + remISO);
                    ev = calcEV(remShutter, remAperture, remISO);
    /* ---------------------------------- END Extracting Data I want to Stamp  formated -------------------------------------------------- */
        catch (e){
            alert("No EXIF data exists..." );
        if ( exifInfo == "" ) {
            alert( "No EXIF data exists..." );
        else {
            // alert( "exifInfo=" + exifInfo );
            text_layer = doc.artLayers.add();                        // Add a Layer
            text_layer.name = "EXIF Stamp";                            // Name Layer
            text_layer.kind = LayerKind.TEXT;                        // Make Layer a Text Layer
            text_layer.textItem.color = textColor;                        // set text layer color
    /* Do not set TextType to Pargarph Text for StampEXIF so action can position text layer
             text_layer.textItem.kind = TextType.PARAGRAPHTEXT;                // Set text layers text type
            text_layer.textItem.font = fontName;                        // set text font
            text_layer.blendMode = BlendMode.NORMAL                        // blend mode
            text_layer.textItem.fauxBold = false;                        // Bold
            text_layer.textItem.fauxItalic = false;                        // Italic
            text_layer.textItem.underline = UnderlineType.UNDERLINEOFF;            // Underlibn
            text_layer.textItem.capitalization = TextCase.NORMAL;                // Case
            text_layer.textItem.antiAliasMethod = AntiAlias.SHARP;                // antiAlias
    //        var fontSize = Math.round((doc.height- textY) / ((numExifItems +1) * sizeFactor)); // Calulate font size to use Item nomber + last \r
            /* Calulate font size to use for StampExit keep size same for landscape and portrait base on document size */
            if (doc.width >= doc.height) {var fontSize = Math.round(doc.height / (30 * sizeFactor));}
            else {var fontSize = Math.round(doc.width / (30 * sizeFactor));}
            if (fontSize<10){fontSize=10};                            // don't use Font size smaller then 10
            text_layer.textItem.size = fontSize;                        // set text font Size
    //        text_layer.textItem.position = Array(textX, textY );                // set text layers position in and down
            text_layer.textItem.position = Array(textX, (textY + fontSize ));        // set text layers position in and down for Stamp add in fontsize
            textWidth = ((doc.width - textX) * 72/testres );                // Text width document width - offset
            textHeight = ((doc.height - textY) * 72/testres );                // Text height document height - offset
    /* Do not set Text Area for StampEXIF so action can position text layer
            text_layer.textItem.width = textWidth;                        // set text area width
            text_layer.textItem.height = textHeight;                    // set text area height
             alert(
            "res=" + res + " sizeFactor=" + sizeFactor + " numExifItems=" + numExifItems
            + "\r" + "fontsize=" + fontSize + " font=" +fontName
            + "\r" + "Image area width=" + doc.width + " height=" + doc.height
            + "\r"    + "text area width=" + textWidth + " height=" + textHeight
            + "\r"    + "Text Position top left=" + textX + "," + textY
            + " bottom right=" + (textX + textWidth )+ "," + (textY +  textHeight )
            try{
                text_layer.textItem.contents = exifInfo;
            catch (er) {
                alert("Error Setting Contents...");
    /* -----------------------------------------  Data Stamp  format ----------------------------------------------------------------------- */
            if (!app.activeDocument.info.copyrightNotice=="") {var Notice = app.activeDocument.info.copyrightNotice; }
            else { var Notice = "Copyright \u00A9 " + Biz  + " " + cpyrt; }   
            if (lat!="" && lon!="") { gps = "\r" + lat +latRef + lon + lonRef;}
            else {gps = ""; }
            text_layer.textItem.contents =  docName + " " + Model + lens + ISO + expTime + Fstop;
            if (app.activeDocument.info.instructions == "" ) {
                app.activeDocument.info.instructions = docName + " " + Model  + lens + ISO  + expTime + Fstop;
        if(res != testres){ app.activeDocument.resizeImage(app.activeDocument.width.value,app.activeDocument.height.v alue,res); }
        app.preferences.rulerUnits = strtRulerUnits;
        app.preferences.typeUnits = strtTypeUnits;
    // END - main function
    // calcEV()
    function calcEV(shutter, aperture, iso) {
        evString = new String("");
        isoValue = new Number(0);
        shutterValue = new Number(0);
        apertureValue = new Number(0);
        evValue = new Number(0);
        apertureValue = aperture;
        apertureValue = apertureValue.substr(2,apertureValue.length -2); // Strip off "f/"
        shutterValue = shutter;
        shutterValue = shutterValue.substr(0,shutterValue.indexOf(" ")); // Strip off ending " sec"
        if ( shutterValue.indexOf("/") != -1) {
            topShutter = shutterValue.substr(0,shutterValue.indexOf("/"));
            bottomShutter = shutterValue.substr(shutterValue.indexOf("/") + 1,shutterValue.length -(shutterValue.indexOf("/") + 1));
            shutterValue = topShutter / bottomShutter;
        isoValue = iso;
        //alert ("apertureValue = " + apertureValue +  " shutterValue = " + shutterValue + " isoValue = " + isoValue );
        if (isoValue>0 && shutterValue>0 && apertureValue>0) {
            evValue = Math.LOG2E * Math.log(Math.pow(apertureValue, 2) * (1 / shutterValue) * (100 / isoValue));
            evValue = Math.round(evValue * 10) / 10;
            evString = "EV " + evValue;
        return evString;;
    function checkThisItem(key, keyData) {
        // alert("Key=" + key + " Data=" + keyData );

    I wrote that script to be used within an Action.  The Action uses the script to add the text layer. The text layer becomes the current active layer.  The action can then position the layer anywhere over the document by aligning the layer to a selection.  Also add a layer style like set fill to 0 and adding a drop shadow and emboss. That is the un-expanded step below the set current layer is setting a style and is lengthy.
    Crafting Actions Package UPDATED Aug 10, 2014 Added Conditional Action steps to Action Palette Tips.
    Contains
    Action Actions Palette Tips.txt
    Action Creation Guidelines.txt
    Action Dealing with Image Size.txt
    Action Enhanced via Scripted Photoshop Functions.txt
    CraftedActions.atn Sample Action set includes an example Watermarking action
    Sample Actions.txt Photoshop CraftedActions set saved as a text file.
    More then a dozen Scripts for use in actions
    Example
    Download

  • Script to search layer names

    Hi -
    Does anyone know if there is a script that can search through layer names within a file for a specific text string and then select it as the active layer?
    For instance, if a file has 4 layers, named My LayerX, LayerY, LayerZ, LayerA, I want to automatically search for a layer that has the text "rA" and make it the active layer.
    Thanks.

    This requires CS4 or better. It searchs using a RegExp and Action Manager so it should be very fast. It is set up now to deal with more than one matching layer.
    var re = /rA/;// a reg exp
    var matches = collectNamesAM(re);// get array of matching layer indexes
    for( var l = 0; l < matches.length; l++ ){
        makeActiveByIndex( l, false );
        // do something with layer
        alert(app.activeDocument.activeLayer.name);
    }// next match if any
    function collectNamesAM(re){
         var allLayers = new Array();
       var startLoop = Number( !hasBackground() );
       var endLoop = getNumberOfLayer();
       for( var l = startLoop;l < endLoop; l++){
            while( !isValidActiveLayer( l ) ) {
                l++;
            if( getLayerNameByIndex( l ).match(re) != null){
                allLayers.push( l );
         return allLayers;
    // Function: getActiveLayerIndex
    // Description: Gets gets the Action Manager API index
    //                        of activeLayer corrected for Background Layer
    // Usage: var idx = getActiveLayerIndex();
    // Input: None
    // Return: Number - correct AM itemIndex
    // Dependices: hasBackground
    function getActiveLayerIndex() {
         var ref = new ActionReference();
         ref.putProperty( 1349677170 , 1232366921 );
         ref.putEnumerated( 1283027488, 1332896878, 1416783732 );
         var res = executeActionGet(ref).getInteger( 1232366921 )
                                                           - Number( hasBackground() );
         res == 4 ? res++:res// why the skip in this doc?
         return res;  
    // Function: isValidActiveLayer( )
    // Description: Checks LayerSection for 'real' layers
    // Usage: if( isValidActiveLayer() )
    // Input: None
    // Return: Boolean - True if not the end of a Set
    // Notes:  Needed only if the layer was made active
    //               using Action Manager API
    function isValidActiveLayer( idx ) {
         var propName = stringIDToTypeID( 'layerSection' );// can't replace
         var ref = new ActionReference();
         ref.putProperty( 1349677170 , propName);// TypeID for "Prpr"
         // 'Lyr ", idx
         ref.putIndex( 1283027488, idx );
         var desc =  executeActionGet( ref );
         var type = desc.getEnumerationValue( propName );
         var res = typeIDToStringID( type );
         return res == 'layerSectionEnd' ? false:true;
    // Function: hasBackground
    // Description: Test for background layer using AM API
    // Usage: if( hasBackground() );
    // Input: None
    // Return: Boolean - true if doc has background layer
    // Notes:  Requires the document to be active
    //  DOM:  App.Document.backgroundLayer
    function hasBackground(){
        var res = undefined;
        try{
            var ref = new ActionReference();
            ref.putProperty( 1349677170 , 1315774496);
            ref.putIndex( 1283027488, 0 );
            executeActionGet(ref).getString(1315774496 );;
            res = true;
        }catch(e){ res = false}
        return res;
    function makeActiveByIndex( idx, forceVisible ){
         try{
              var desc = new ActionDescriptor();
              var ref = new ActionReference();
              ref.putIndex(charIDToTypeID( "Lyr " ), idx)
              desc.putReference( charIDToTypeID( "null" ), ref );
              desc.putBoolean( charIDToTypeID( "MkVs" ), forceVisible );
              executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );
         }catch(e){ return -1;}
    function getNumberOfLayer(){
    var ref = new ActionReference();
    ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
    var desc = executeActionGet(ref);
    var numberOfLayer = desc.getInteger(charIDToTypeID("NmbL"));
    return numberOfLayer;
    function getLayerNameByIndex( idx ) {
        var ref = new ActionReference();
        ref.putProperty( charIDToTypeID("Prpr") , charIDToTypeID( "Nm  " ));
        ref.putIndex( charIDToTypeID( "Lyr " ), idx );
        return executeActionGet(ref).getString(charIDToTypeID( "Nm  " ));;

  • Script to change layer name in to Document name.

    Hi I would like to make the active layer name the same as the document name.  I know very little about scripting.  I found this script:
    var idoc = app.activeDocument;
    var ilayer = idoc.activeLayer;
    var filename = idoc.name;
    ilayer.name = filename;
    It does almost what I need it to do. except that it also copies the ".ai" in to the layer name.  Is there some way to modify this script to have it exclude or delete the file extension?
    Thanks for any help.

    Or, if you want to keep the same construction as your example...
    var idoc = app.activeDocument;
    var ilayer = idoc.activeLayer;
    var filename = idoc.name;
    filename = filename.slice (0, filename.lastIndexOf(".")); //just add this line to the construction.
    ilayer.name = filename;
    Gustavo.

  • Do I get charged for using Itunes player or just for downloads?

    Hi,
    I never used Itunes before.  I've downloaded the player, completed all my details - user name, email etc.  But the question I have am I charged for using the Itunes player or just for the download originally?

    Neither.  The iTunes player is a free download, and there is no charge for using it.
    You will only incur a charge if you make a purchase at the iTunes Store.

  • Script for adding layer name to artboard as text

    I've found scripts that are sort of close but not quite this.
    I have 1 artboard and many layers (see image).
    Does anyone have a script that will take the name of the layer, ie "01_Intro" and create and then place the text "01_Intro" on to the art board in layer 01_Intro? Then it would repeat the process for all the present layers?
    Thanks in advance!

    Waterbear,
    something like this?
    // LayersnamesInUpperLeftCorner.jsx
    // https://forums.adobe.com/thread/1546630
    // write layers names in upper left corner of the active artboard
    // required: opened document, no toplevel layers locked, all layers visible
    // regards pixxxelschubser
    var aDoc = app.activeDocument;
    var theLayers = aDoc.layers;
    for (i=0; i<theLayers.length; i++) {
        var txt = theLayers[i].textFrames.add();
        txt.position = [0,0];
        txt.contents = theLayers[i].name;
    Have fun

  • What font did Adobe use for the Layer names and context bar (OSX PS CS1)?

    I have a problem with my Snow Leopard install. When I disabled the font protection of OSX, to install the full Helvetica Neue set (not just the limited DFont set in OSX), I damaged something. All text in Photoshop CS1 that is used in the input fields of the context bar, and for the names of layers, paths etc is wrong. As text is too big now, the program is harder to use.
    What font is normally used in these locations? I need to know what files to put back.

    Things change.
    Adobe changes things that don't really need changing so they can call it a new .0 version and sell it for a bunch of money.  They also change things to follow modern trends in UI design.
    Sometimes, they want to push other tools to do some of the things Photoshop used to do.  This is so they can make even more money by selling more products!
    Have you been through every intermediate version, or are you making a several version jump?  I ask because the total amount of change in each .0 version has been manageable.  And I personally feel the changes have been worth the money, though perhaps just barely.  That's the key in business.
    -Noel

  • Artboard name and save for web or export

    Hi when saving for web or exporting an artboard is there any way to pre-populate the save file name dialog box with the artboard's given name. It would save having to re-name the file and make good use of that metadata.
    Thanks in advance

    There is a way, but you have to use file >> export >> jpg.
    Worked great for me here where I have my artboards named the flavor, and when asked for fielname used "a".

  • Facebook publishing uses Version name as description for Facebook uploads

    Facebook publishing on Aperture 3 uses my Version name as the description on Facebook. Is there a way to keep it from doing that or change what metadata it uses for the description? I would love to be able to write a caption in Aperture and have that show as the description. Otherwise, I would like the description to be left blank on Facebook rather than putting the Version name.

    I never found a fix for this. I also realized that if you ever delete the sync folder from Aperture, the pictures in Facebook will be deleted as well. So I've simply stopped using the Facebook publishing feature from Aperture. Now I'm back to the usual: export a folder of the images I want to upload, upload that folder to Facebook, and delete that folder after uploading it since I have the original file elsewhere.

  • Using Table name as value for formula

    I am using a table as a list for lookup in other tables using vlookup. The entire table is the source, so I'd like to do something like:
    =Vlookup("value to lookup", TableName, 3)
    However, it seems the entire reference including columns must be included. Is this so?
    Thanks for your help.

    I understand why they didn't do this. Many times you do not need to look up the values in the A column, but in the B or C column. This forces the novice user, and advanced users, to fully evaluate their expression. e.g. Numbers should not make any assumptions about your intentions.
    A novice user might see experienced users that use the shorthand for examples, and assume that you MUST use the entire table, and they would go off making these very odd looking tables just to accommodate this misconception.
    I wouldn't doubt if they tested this with a small set of novice users and got some very confused responses. then nixed it.
    just my 2 cents from writing programs for those very users,
    Jason

Maybe you are looking for

  • NFe Estorno - Configurando cancelamento e Inutilização

    Bom dia Pessoal, tudo bem com vocês? Sei que pode parecer uma coisa simples para vocês, mas tenho uma duvida e gostaria entender melhor e resolvi procurar a experiencia de vocês sobre o assunto. Sendo assim, gostaria de saber se um processo de estorn

  • Printing from HP LaserJet 1100

    I have an HP LaserJet 1100 that used to print from a PC that died. How can I get it to print from my new iMac G5? I went to the HP website and couldn't find drivers for any Mac OS. Thanks for any help.

  • Macbook air crashed when using USB.

    My macbook air crashed when I plugged in my new portable charger in the USB, and it refuse to start again. Nothing is happening when Im trying to start the mac. Is the macbook totally destroyed or can I fix this in some way? appreciate your help!

  • Flash Player Freezing

    Hi i hope someone out there has had this same issue and has a solution as i am out of ideas the problem i am experiencing is with ie8 and firefox versions of flash player everything has been working great for some time now until the last couple of da

  • ORA-06512: na "PORTAL30.WWSEC_OID",

    Hi, In Windows 2000 when I try run the ptlasst.bat for syncronize the MIDTIER and the OID I receive the following errors in logs: INSTALL_ERROR: Exception while getting User base count: ORA-06510: PL/SQL: ORA-06512: na "PORTAL30.WWSEC_OID", line 957