Photoshop (CS4)-Saving out layers & names?

I was wondering if someone can help me out.  I am trying create an action-script and can't seem to make it happen.  Specifically, I have a Photoshop file with five layers. Each layer having it's own name. Is there a way to save out each layer with that layers name? I tried to incorporate a copy and paste but didn't work.
Any ideas how to do this?
Thank you in advance!
~e

Please try this...
#target photoshop
var doc = activeDocument;
var oldPath = activeDocument.path;
for(var a=0;a<doc.layerSets.length;a++){
activeDocument.activeLayer = activeDocument.layers.getByName(doc.layerSets[a].name);
dupLayers();
var saveFile= File(oldPath +"/"+doc.layerSets[a].name +".jpg");
SaveJPEG(saveFile,8);
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
function dupLayers() {
    var desc143 = new ActionDescriptor();
        var ref73 = new ActionReference();
        ref73.putClass( charIDToTypeID('Dcmn') );
    desc143.putReference( charIDToTypeID('null'), ref73 );
    desc143.putString( charIDToTypeID('Nm  '), activeDocument.activeLayer.name );
        var ref74 = new ActionReference();
        ref74.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
    desc143.putReference( charIDToTypeID('Usng'), ref74 );
    executeAction( charIDToTypeID('Mk  '), desc143, DialogModes.NO );
function SaveJPEG(saveFile, jpegQuality){
jpgSaveOptions = new JPEGSaveOptions();
jpgSaveOptions.embedColorProfile = true;
jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
jpgSaveOptions.matte = MatteType.NONE;
jpgSaveOptions.quality = jpegQuality; //1-12
activeDocument.saveAs(saveFile, jpgSaveOptions, true,Extension.LOWERCASE);

Similar Messages

  • Photoshop cs4 pull out "indented writing" from old book

    Hey everyone, Im new to not only photoshop, but to the forums as well. First off I would like to give my thanks in advance for any help that is provided, if it was for people like you id prob go crazy. i have an extremly old book which is worth a substancual amount of money and i have photographed the book page by page and have noticed some indented writing on several pages. given the age and placement of this book i need to know what the indented wring says. i was wondering how i could use photoshop cs4 to bring out that writing and possibly color it in so it was then, readable. again any help is extremly appericated.
    Thanks,
    Glenn

    Glenn,
    It appears that you wish to enhance annotations on the pages, that are very light, and are not showing well enough in your photographs.
    I would look at using the Threshold Adjustment, to see if you can extract that info. Go very slowly with the settings, and study the results carefully. If you can do what you want, you might be able to use that image, adjusted, as a Layer in your photographs, and explore both Blending Modes and also Layer Masks, to get those annotations onto the "page" with the normal type.
    I had to do a series of shoots for some of William Faulkner's original manuscripts. As has been suggested, I used a piece of optical Lucite to both flatten, and to hold the pages. The lighting on the copy stand had to be adjusted a bit, as we could not force the spine of these notebooks in any way, so that the opposite pages and covers were up higher. Not an easy task, and we had to fight any/all reflections by those angle adjustments. Normally, 45 degrees and broad/flat is best, but we had to fight that angle, so as to not get any shadows.
    Good luck,
    Hunt

  • Photoshop CS4 - Saving file displays a Quicktime Preview Error

    Hi,
    I recently transferred my system from an iMac to a Macbook Pro (OS X 10.6.3). Everything seems to work except every time I now go to save a file in Photoshop (CS4) it displays a message: "Could not build a preview because of a problem with Quicktime"
    I've searched forums, un-installed and re-installed Photoshop and still no fix. Even setting save Preview to 'never' in Photoshop Preferences does not help. Has anyone seen this? Is there a preferences or permission that I need to fix or trash in Quicktime?

    Hi Chris,
    Thanks for your reply. I also tried reinstalling Quicktime X from the install disk (using the Pacifist application), still did not fix. I did however find that setting the Save preview preferences then closing and re-starting Photoshop does sort of fix the problem. With the Macintosh preview disabled the message does not appear so yes I would say it's an OS problem.
    Would still be nice to know if there is an actual fix, as yet I haven't seen the error in any other application.
    Update: I also found 'copy to clipboard' and 'paste into PS' also did not work! So after a day of erasing the MacPro hard drive and re-installing the OS and all applications from scratch everything seems to work correctly. Seems Apple's migration from one computer to another really doesn't work that well.

  • Photoshop CS4, Saved a Tiff file now won't open correctly

    I saved a file as a .tif and it saved as normal then I shut down Photoshop and then the PC. The next day when I try to open the file it doesn't open correctly it opens but the right hand side of the photo is on the left and the left hand side of the image is now on the right, its like its been cut in half and put pack the wrong way.
    It also didn't open with the layers only as a locked background. When I view the file in the icon it looks fine until I open it.
    Help!

    Laura, I'd guess this is not promising for you.  TIFF files tend to be large, so I am wondering if you might have closed Photosho and the PC before it had finished saving?  Do you remember the pixel size of the original image, and what is the file size in Mb?  I am not sure how Photoshop treats TIFF images, depite them owning the file format after buying it from Aldus a few years ago, but it sounds like it was saved as a series of tiles, and the information about the order of those tiles is corrupted.  You might be able to Google TIF file recovery program, but it is unlikely you'll get the full file back with all the information saved with it.
    If you don't get a better answer, keep a weather out for when Chris Cox is posting, and bump this thread. 
    Good luck

  • Photoshop cs4 crashing on saving

    hi,
    My problem
    i have a problem with photoshop crashing on me, in particular when saving it also crashes when doing a large task e.g... rendering lighting effects, running a batch web gallery, site-grinder and trying to perform an action.
    After past trouble shooting (described below) if i opened photoshop through bridge (bridge open on selected photo double click to open photoshop with photo) can do minor edit, and when trying to save it crashes!! very sad .. i found that if i made sure i opened photoshop first, then open selected photo i could save ... as of late am getting back to original problem of crashing regardless of opening procedure upon trying to save work. sigh .. (i have not added anything new, just the same as before.) at the moment saving is a bit of a hit or miss .. i hold my breath saving!!
    i make sure that there is a little as possible of other software open at same time .. generally just mail, fire-fox and bridge.
    i let photoshop open fully on own with out any disturbances .. e.g. checking mail or doing anything else on comp at same time .. the same goes for quitting or running anything automative.
    I am only having this problem in photoshop.
    i have spoken to mac support and they say that they can not help as is only happening in photoshop.
    i have run disk utilities and comp all fine.
    I have photoshop cs4 extended running on a macbook pro, version 10.4.11.
    Hardware Overview:
    Model Name: MacBook Pro 15"
    Model Identifier: MacBookPro2,2
    Processor Name: Intel Core 2 Duo
    Processor Speed: 2.16 GHz
    Number Of Processors: 1
    Total Number Of Cores: 2
    L2 Cache (per processor): 4 MB
    Memory: 3 GB
    Bus Speed: 667 MHz
    Boot ROM Version: MBP22.00A5.B07
    SMC Version: 1.12f5
    Sudden Motion Sensor:
    State: Enabled
    i run photoshop in rosetta. i have a plugin called Lucis Art that requires this.
    i also have a plugin called fluid mask 3
    all these are legal copies i have paid for.
    i have no additions actions, brushes installed etc .. normal fonts + only a couple of extra's - legal versions (edwardian script, sanvito, country garden) have tested to see if fonts installed are corrupt and don't appear to be.
    my past trouble shooting.
    i created a whole new user on mac and trashed old user started everything from fresh, with no plugins, tested all when installing, re-setting presets on opening photoshop. there was another along those lines but can't remember.
    i hope i have provided you with enough information to help me. i have read somewhere that it could be a scratch disk issue ... not sure but would think this was enough ..
    i desperately need to have my programs working and hope someone out there can help me!
    PLEEEEEAAAASE :)
    Danielle

    Hello,
    I'm actually having a similar problem to Danielle's. I googled "Photoshop CS4 Saving Issues," and this was one out of two things that popped up!
    I'm editing a wedding with CS4. I just switched to the trial version and am purchasing in about a week or so. Have been having no issues until the past couple of days. I drag a series of JPEG photos from CS4 Bridge into Photoshop. I edit a JPEG photo with some actions (thereby creating layers), hit "Save As" and I hit "JPEG." It automatically wants to save that file as a "copy" but I delete copy because I want it to save over that file.
    Typically up pops a box saying "Cancel" or "Replace." About 70% of the time it works, but 30% of the time that box with "Cancel" and "Replace" comes up blank, and I have to force quit Photoshop because it freezes.
    I originally thought the problem was my new terabyte hard drive, so I stopped editing on that. Now I'm editing on my actual iMac hard drive (which has 100GB available). But it still keeps happening. Now I'm thinking it
    has to be a CS4 issue, but I have no idea what. Could it be the actions I'm using? The number of files I open at once? I can't figure it out. I'm not super computer savvy, so I'm hoping someone can help!
    Many thanks in advance,
    Lisa

  • Photoshop cs4 makes huge files - but with Aperture Whats the biggest file ?

    When editing w/Photoshop cs4 by adding layers and masks etc, This makes HUGE files - but with using Aperture alone, what's the biggest file size when editing a RAW file?? (??? _Kb ??? __ mgB ????)
    I think I heard -12kb. True ?_________ From what little I understand. Aperture changes the pixels once you have finished the editing. Or to put it another away, Aperture replaces the old or original pixels with the edited final pixels you prefer. IE -lighter darker. and with that said. is this still a RAW IMAGE?

    Hello, and welcome to the Discussions.
    It would seem that none of what you report hearing is accurate. A RAW file downloaded into Aperture, remains as the Master for this image, and is never changed -- that is why Aperture is said to utilize non-destructive editing. When editing in Aperture, only a small file of edit detail is saved, and no actual new version needs to be created until you Export for some purpose.
    When you send an image file from Aperture to Photoshop to be edited, it typically will be a version created as a TIFF file, although there are 4 choices in the Preferences -- TIFF, TIFF 16-bit, PSD, and PSD 16-bit. When finished editing, the image is Saved in PS, that file is available to Aperture, and the version created for sending to PS will change to reflect those changes made in PS.
    Aperture cannot send an edited RAW file to PS in this fashion, but you can Export the RAW Master, to later be opened in Photoshop.
    You should watch all the available online tutorials about Aperture, and possibly buy a book as well.
    Aperture may have trouble with super-sized images, but I have not had trouble with those in the range of 100 MB or less. Larger ones than that would likely be from scans and not from editing an image shot with your camera in Photoshop.
    Ernie

  • Incorrectly coloured text when saving to .PDF using Photoshop CS4

    I am using Photoshop CS4 on Windows 7, and have designed my own business card.
    When saving to .PDF to send to printers I am finding that a small section of text is saving with a white section to it, for example out of the 3 lines of text on the card the bottom left hand corner of the & sign I have in the design is coming out white, the rest of the text is a golden colour.
    I have tried searching on this forum and on google but can't seem to find anyone with my actual problem so unsure where to go.
    Any help much appreciated.
    Thanks

    Mylenium wrote:
    Well, you could change the native text color instead of using layer styles, could you not?
    Mylenium
    Or make the Type and Hyphen layers into a single Smart Object and clip a yellow layer to it.

  • Photoshop CS4 "Freezes" when saving as a JPEG

    I have been using Photoshop CS4 with SnowLeopard and my MacPro for months now without a problem. I save multiple images everyday, often as JPEGs for the Web. But today, out of the blue with nothing changing (no new updates, or plugins), Photoshop "locks up" when saving a JPEG. I can still move the curser arrow, but everything is dead and the file did not save. I have to hit ESC just to get PS back online. I can save other file types, no problem.
    Has anyone experienced this? Any help or solutions? I have the latest version of PS CS4.
    (Note: If I go under Save for Web & Devices I can save it as a JPEG, but seems like an less than timely run-around)

    I have not experienced that problem, but with all unexplainable Photoshop-problems You might try trashing the prefs (after making sure all customized presets like Actions, Patterns, Brushes etc. have been saved and making a note of the Preferences You’ve changed) by pressing command-alt-shift on starting the program or starting from a new user-account.
    System Maintenance (repairing permissions, purging PRAM, running cron-scripts, etc.) might also be beneficial.

  • Saving Jpeg in Photoshop CS4 and having problems

    Okay, i have been looking all over the internet and i hope it's something really foolish...
    After editing a photo in Photoshop (CS4) and saving it as a JPEG / JPG, many people using windows can't open the file, and it gets the extension .JPGG ( ...?... )
    If I import the picture in Iphoto first and then mail it ther is no problem.
    perhaps this is quite obvious to some, but it's a mystery to me.
    To update my website i need to save my JPG files to an XML folder and then flash reads the files and opens them in the site.
    The JPG files i saved using photoshop won't open in the site, even worse, the site won't even load because the loader gets 'stuck'.
    i tried putting them in Iphoto first because that helped with with mailing, but it doesn't seem to be working this time.
    I've tried all the JPG saving options like Baseline etc. converted them to RGB ( they already were) so i'm out of options.
    ANYONE ?

    Welcome to the Apple Discussions. I have CS3 so don't know if there's major changes to the formatting process by each version. That may be a question to ask in the Adobe support forum.
    However, for a workaround you might try using the Automator workflow I created to change any image file to jpg with the sRGB color profile. Just drag the files onto the workflow icon and they will be converted. You can get it, "Convert to JPG and Embed sRGB profile", at Toad's Cellar. See if those jpgs will work OK. There will be some jpeg compression applied but if they are for posting on the web it may not be objectionable.
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto (iPhoto.Library for iPhoto 5 and earlier) database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger or later), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 6 and 7 libraries and Tiger and Leopard. Just put the application in the Dock and click on it whenever you want to backup the dB file. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.
    Note: There's now an Automator backup application for iPhoto 5 that will work with Tiger or Leopard.

  • Why Does Premiere Pro CS4 Import Only 10 Seconds Of Layered Photoshop CS4 .psd??

    Why Does Premiere Pro CS4 Import Only 10 Seconds Of Layered Photoshop CS4 .psd??
    I have a 24 second clip I layered in Ps and when I import the psd into Pr THE SEQUENCE IS ALWAYS ONLY 10 SECONDS!
    How can I change this?  Why does this happen?  I really need to know as soon as possible.  I have a video project due this Wednesday (granted it's for an AV class where I'm just learning Pr.  But I can learn VERY FAST!)
    Thanks for your help.
    --OSXniCKels

    Just in case I wasn't clear in my last line "just Click-drag on the Tail of your .PSD to set the desired Duration," once you have Imported your .PSD (as Footage), just drag it to the Timeline, Click-drag on the right-hand margin (the Tail) and stretch out its Duration, as is required.
    Now, if you Imported as a Sequence, open that Sequence's Timeline, and do the same.
    I normally will set my Edit>Preferences>Still Duration to about what I think will be applicable, do my Import, and then with the Info Panel handy, just alter the Duration to suit.
    Good luck,
    Hunt
    PS - Welcome to the forum.

  • Photoshop CS4 file saving problem...

    Photoshop CS4 file saving problem: When no file name is specified, Photoshop saves file to the root directory of the drive instead of the current folder. It auto names the image with the name of the folder that was active. Can this be fixed?
    BTW: I was using "save for web"--not sure if it that matters.

    Bug reports should go in the main forum.
    And yes, SFW has it's own file code so that is a very important detail.

  • Photoshop cs4-snow leopard-automatically save files with same name.

    Does anyone know how to automatically update a file in another folder that has the same name as the current file? (photoshop cs4-snow leopard)

    Does this apply to all files you work on?
    How are the parallel files being defined – by location relative to the edited ones, filename, foldername, …?
    Will an index of the parallel files have to be written into the files’ metadata?
    And what’s behind this, why do you need multiple instances of the saved file, if I may ask?

  • Photoshop CS4 and Grab crashing saving images

    I did an upgrade from 10.5.8 to 10.6 and I am having issues with what seems to be image files. When I save a screenshot from Grab to a .tiff it crashes 90% of the time. Saving in Photshop a JPEG also crashes photoshop cs4. Anyone have any ideas? Ive included some logs below..
    8/30/09 3:48:59 AM [0x0-0x106106].com.apple.Grab[1611] Grab(1611,0x7fff70d57be0) malloc: * error for object 0x114b07c90: pointer being freed was not allocated
    8/30/09 3:48:59 AM Grab[1611] Grab(1611,0x7fff70d57be0) malloc: * error for object 0x114b07c90: pointer being freed was not allocated
    * set a breakpoint in mallocerrorbreak to debug
    8/30/09 3:48:59 AM [0x0-0x106106].com.apple.Grab[1611] * set a breakpoint in mallocerrorbreak to debug
    8/30/09 3:49:06 AM com.apple.launchd.peruser.501[179] ([0x0-0x106106].com.apple.Grab[1611]) Job appears to have crashed: Abort trap
    Full crash report at http://pastebin.com/f2b3da603
    Then for Photoshop CS4
    8/29/09 3:06:12 PM [0x0-0x73073].com.adobe.Photoshop[827] Adobe Photoshop CS4(827,0xa0139500) malloc: * error for object 0x49085e0: Non-aligned pointer being freed (2)
    8/29/09 3:06:12 PM [0x0-0x73073].com.adobe.Photoshop[827] * set a breakpoint in mallocerrorbreak to debug
    8/29/09 3:06:12 PM [0x0-0x73073].com.adobe.Photoshop[827] Adobe Photoshop CS4(827,0xa0139500) malloc: * error for object 0x4908760: Non-aligned pointer being freed (2)
    8/29/09 3:06:12 PM [0x0-0x73073].com.adobe.Photoshop[827] * set a breakpoint in mallocerrorbreak to debug
    8/29/09 3:06:12 PM [0x0-0x73073].com.adobe.Photoshop[827] Adobe Photoshop CS4(827,0xa0139500) malloc: * error for object 0x49087a0: Non-aligned pointer being freed (2)
    8/29/09 3:06:12 PM [0x0-0x73073].com.adobe.Photoshop[827] * set a breakpoint in mallocerrorbreak to debug
    8/29/09 3:06:23 PM Adobe Photoshop CS4[827] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary.
    8/29/09 3:06:23 PM Adobe Photoshop CS4[827] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary.
    8/29/09 3:06:23 PM Adobe Photoshop CS4[827] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary.
    8/29/09 3:06:23 PM Adobe Photoshop CS4[827] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary.
    8/29/09 3:06:23 PM Adobe Photoshop CS4[827] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary.
    8/29/09 3:06:23 PM Adobe Photoshop CS4[827] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary.
    8/29/09 3:06:23 PM Adobe Photoshop CS4[827] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary.
    8/29/09 3:06:23 PM Adobe Photoshop CS4[827] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary.
    8/29/09 3:06:23 PM Adobe Photoshop CS4[827] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary.
    8/29/09 3:06:25 PM [0x0-0x73073].com.adobe.Photoshop[827] Adobe Photoshop CS4(827,0xa0139500) malloc: * error for object 0x493c2e0: Non-aligned pointer being freed (2)
    8/29/09 3:06:25 PM [0x0-0x73073].com.adobe.Photoshop[827] * set a breakpoint in mallocerrorbreak to debug
    8/29/09 3:08:23 PM com.apple.launchd.peruser.501[179] ([0x0-0x73073].com.adobe.Photoshop[827]) Job appears to have crashed: Bus error
    Full crash report at http://pastebin.com/f6a4ac2a8

    I too was having the same problem with Web Premium CS3. Working with my previously created animated GIF files, or certain JPGs were causing either Ps to crash or even Safari to crash when I was trying to attach those same files and send them to clients via email. I got frustrated and am reinstalling the OS from scratch. I have a solid backup and thought this might clear up things (not to mention make me feel better cause I am cleaning house at the same time). Just now going through the forums to find others are having the same issues. If this does not fix the problem, I shall be back for more assistance. As a graphic/web designer, working in graphic files is my life (bread & butter).

  • Photoshop CS4 won't open Crashes immediately. Out of ideas

    CS4, Windows 8.1
    My graphics drivers are up to date. I've not installed any third party items for PS.
    I've uninstalled, used clean script, reinstalled several times. ran the repair license (multiple times), changed flexnet licensing from manual to auto and back again during the many tries of repairing. Rolled back the date as Adobe mentions. Rebooted many times. Checked my fonts against the 'trouble list' though none have been installed in weeks. Deleted the preferences. Long list of things I have tried.
    I'm out of ideas. Computer is about 6 weeks old. I installed it with no issues then. Program worked a few weeks. Yesterday I tried opening it and it crashes immediately. It opens enough that I can see the main screens then the error comes up. The only message is "adobe photoshop CS4 has stopped working" " A problem caused the program to stop working correctly. Windows will close the program......" No details are provided as to the issue. The only option is to close. I rebooted in safe mode and got the code of 148.3. Repairing the license with the adobe fix still doesn’t correct it.
    Any ideas on what else to try?

    Crash logs.
    Working with your Operating System’s Tools | Mylenium's Error Code Database
    Mylenium

  • Help with add file name problem with Photoshop CS4

    Frustrating problem: Help with add file name problem with Photoshop CS4. What happens is this. When I am in PS CS4 or CS3 and run the following script it runs fine. When I am in Bridge and go to tools/photoshop/batch and run the same script it runs until it wants interaction with preference.rulerunits. How do I get it to quit doing this so I can run in batch mode? Any help is appreciated. HLower
    Script follows:
    // this script is another variation of the script addTimeStamp.js that is installed with PS7
    //Check if a document is open
    if ( documents.length > 0 )
    var originalRulerUnits = preferences.rulerUnits;
    preferences.rulerUnits = Units.INCHES;
    try
    var docRef = activeDocument;
    // Create a text layer at the front
    var myLayerRef = docRef.artLayers.add();
    myLayerRef.kind = LayerKind.TEXT;
    myLayerRef.name = "Filename";
    var myTextRef = myLayerRef.textItem;
    //Set your parameters below this line
    //If you wish to show the file extension, change the n to y in the line below, if not use n.
    var ShowExtension = "n";
    // Insert any text to appear before the filename, such as your name and copyright info between the quotes.
    //If you do not want extra text, delete between the quotes (but leave the quotes in).
    var TextBefore = "Lower© ";
    // Insert any text to appear after the filename between the quotes.
    //If you do not want extra text, delete between the quotes (but leave the quotes in).
    var TextAfter = " ";
    // Set font size in Points
    myTextRef.size = 10;
    //Set font - use GetFontName.jsx to get exact name
    myTextRef.font = "Arial";
    //Set text colour in RGB values
    var newColor = new SolidColor();
    newColor.rgb.red = 0;
    newColor.rgb.green = 0;
    newColor.rgb.blue = 0;
    myTextRef.color = newColor;
    // Set the position of the text - percentages from left first, then from top.
    myTextRef.position = new Array( 10, 99);
    // Set the Blend Mode of the Text Layer. The name must be in CAPITALS - ie change NORMAL to DIFFERENCE.
    myLayerRef.blendMode = BlendMode.NORMAL;
    // select opacity in percentage
    myLayerRef.opacity = 100;
    // The following code strips the extension and writes tha text layer. fname = file name only
    di=(docRef.name).indexOf(".");
    fname = (docRef.name).substr(0, di);
    //use extension if set
    if ( ShowExtension == "y" )
    fname = docRef.name
    myTextRef.contents = TextBefore + " " + fname + " " + TextAfter;
    catch( e )
    // An error occurred. Restore ruler units, then propagate the error back
    // to the user
    preferences.rulerUnits = originalRulerUnits;
    throw e;
    // Everything went Ok. Restore ruler units
    preferences.rulerUnits = originalRulerUnits;
    else
    alert( "You must have a document open to add the filename!" );

    you might want to try the scripting forum howard:
    http://www.adobeforums.com/webx?13@@.ef7f2cb

Maybe you are looking for

  • Stock transfer are not showing correct expire date for Shelf life subcontracting

    Hi Gurus, We have shelf life active for PPDS. We had added 5 characteristic to have min and Max shelf life in APO so that data will be considered during pegging. Self life works perfectly fine for production plant where based on manufacture date min

  • OS 10.9.5 & Safari 7.1

    Undated to 10.9.5 and Safari 7.1 simultaneously. Upon browser launch it said "extensions  have migrated" (who the **** knows where?). All extensions appeared in the preferences panel as usual, all had been de-activated. Re-activated those I wanted an

  • How to Cancel Scheduled Job in DB13

    Dear All, I have scheduled transaction log backup in DB13. But its getting fail due to device error. Now i want to cancel this. I know it can be cancelled through db13 but i m not getting from where i can cancell. Pls guide me step by step. rgds Awni

  • Configuring Group Key in Customer Master

    Dear Folks, I would like to add more group keys for selection in the field KNA1-KONZS. This field is in the customer master => general data => control data => group key. Could anyone advice me where in SPRO can I add more values to this field? Thank

  • Using certificates with ACS

    Does any of you know how to configure certificates in ACS?, any reference for this issue? thanks